%% syntaxe : A B C points3dalignes -> bool
/points3dalignes {
3 dict begin
/C defpoint3d
/B defpoint3d
/A defpoint3d
A B vecteur3d /u defpoint3d
A C vecteur3d /v defpoint3d
u v vectprod3d norme3d 1E-7 lt
end
} def
%% syntaxe : M A B point3dsursegment --> true si M in [AB], false sinon
/point3dsursegment {
3 dict begin
/B defpoint3d
/A defpoint3d
/M defpoint3d
M A B points3dalignes {
M A vecteur3d
M B vecteur3d
scalprod3d 0 lt {
true
} {
false
} ifelse
} {
false
} ifelse
end
} def
|