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.
Points in three dimensions
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)