PointOrientation - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ComputationalGeometry

  

PointOrientation

  

determine the orientation of points accurately

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

PointOrientation( P1, P2, P3 )

PointOrientation( P1, P2, P3, P4 )

PointOrientation( A, pos )

Parameters

Pn

-

three points in real 2-D or four points in real 3-D space given as lists or rtables of their coordinates

A

-

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[8]

pos

-

positive integer indices of the three or four rows of A to treat as input

Description

• 

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.

Examples

withComputationalGeometry:

a0,0;b1,1;c0.4,0.8;d0.8,0.4;e0.5,0.5

a0,0

b1,1

c0.4,0.8

d0.8,0.4

e0.5,0.5

(1)

plots:-displayplottools:-pointa,b,c,d,e,symbolsize=20,plots:-textplotc,c,align=above,left,plots:-textplotd,d,align=below,right,plots:-textplote,e,align=above,left,plottools:-arrowa,b,0.001,0.025,0.05,axes=box

PointOrientationa,b,c

ccw

(2)

PointOrientationa,b,d

cw

(3)

PointOrientationa,b,e

degenerate

(4)

AArraya,b,c,d,e,datatype=float8,order=C_order

A0.0.1.1.0.4000000000000000.8000000000000000.8000000000000000.4000000000000000.5000000000000000.500000000000000

(5)

PointOrientationA,1,2,5

degenerate

(6)

Points in three dimensions

a0,0,0;b1,1,0;c0.4,0.8,0

a0,0,0

b1,1,0

c0.4,0.8,0

(7)

d0.8,0.4,1;e0.5,0.5,1;f0.5,0.5,0

d0.8,0.4,−1

e0.5,0.5,1

f0.5,0.5,0

(8)

plots:-displayplottools:-pointa,b,c,d,e,f,symbolsize=20,plots:-textplota,a,b,b,c,c,d,d,e,e,f,f,dimension=3,align=left,above,plottools:-polygon0.1,0.1,0,1.1,0.1,0,1.1,1.1,0,0.1,1.1,0,color=Green,plots:-arrowa,0,0,0.4,axes=box

PointOrientationa,b,c,d

ccw

(9)

PointOrientationa,b,c,e

cw

(10)

PointOrientationa,b,c,f

degenerate

(11)

PointOrientationa,b,f,e

degenerate

(12)

Compatibility

• 

The ComputationalGeometry[PointOrientation] command was introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

ComputationalGeometry[PointInCircle]