determine the orientation of points accurately
PointOrientation( P1, P2, P3 )
PointOrientation( P1, P2, P3, P4 )
PointOrientation( A, pos )
three points in real 2-D or four points in real 3-D space given as lists or rtables of their coordinates
an array of point coordinates in 2-D or 3-D space. Each point is a row in the array. A must be C_order and datatype=float
positive integer indices of the three or four rows of A to treat as input
This command returns a string describing the orientation of the points.
In dimension two, if the third point is on the left side of the ray starting at the first point and going through the second point then the points are in counterclockwise orientation and the command returns "ccw". If the third point is on the right then "cw" is returned. If the three points are on a line then "degenerate" is returned.
The check is done by carefully computing the signed area of the triangle formed by the three points.
In dimension three, the command returns "ccw" if the fourth point is below the plane defined by the first three and "cw" if it is above (using a right-hand rule for plane orientation). If the first three points are on a line, or the fourth point lies on the plane, then "degenerate" is returned.
The last calling sequence is designed for checking large collections of points without having to make copies of their values.
a ≔ 0,0;b ≔ 1,1;c ≔ 0.4,0.8;d ≔ 0.8,0.4;e ≔ 0.5,0.5
A ≔ Array⁡a,b,c,d,e,datatype=float8,order=C_order
Points in three dimensions
a ≔ 0,0,0;b ≔ 1,1,0;c ≔ 0.4,0.8,0
d ≔ 0.8,0.4,−1;e ≔ 0.5,0.5,1;f ≔ 0.5,0.5,0
The ComputationalGeometry[PointOrientation] command was introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
Download Help Document
What kind of issue would you like to report? (Optional)