vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

function between() #384

Closed asyvn closed 11 months ago

asyvn commented 1 year ago

Hi,

I have code and use function between to check O between B and C. Return value is 'true'. This function returns true when 3 points are not collinear?

My code:


import geometry;
unitsize(1cm);
defaultpen(fontsize(7pt));

point A = (0.9, 3); dot("$A$", A, NW);
point B = (0,0); dot("$B$", B, SW);
point C = (5,0.4); dot("$C$", C, SE);
point O = circle(A, B, C).C; dot("$O$", O, NW);

write(between(B, O, C));```

between() function use sameside() function may be cannot check 3 points collinear?
johncbowman commented 11 months ago

To test for colinearity, check whether orient(B,O,C) == 0.