ComputationalGeometry
PointInPolygon
determine if a point lies within the polygon formed by a list of points
Calling Sequence
Parameters
Description
Examples
Compatibility
PointInPolygon( P, Q )
P
-
a point in real 2-D space given as a list or rtable of coordinates
Q
a list of points in real 2-D space
This command returns a string describing the orientation of the point P relative to the polygon formed by the points Q. If P is inside the polygon then the command returns "inside". If P is outside then "outside" is returned. If P lies on the boundary of the polygon, then "boundary" is returned.
with⁡ComputationalGeometry:
Q≔1.1180,0.36327,0.,1.1756,−1.1180,0.36327,−0.69098,−0.95106,0.69098,−0.95106
a≔0.,0.:b≔1.,1.:c≔0.5⁢Q1+0.5⁢Q2:
plots:-display⁡plottools:-point⁡a,b,c,symbolsize=20,plots:-textplot⁡a,a,align=above,left,plots:-textplot⁡b,b,align=above,left,plots:-textplot⁡c,c,align=below,left,plottools:-polygon⁡Q,style=line,axes=box
PointInPolygon⁡a,Q
inside
PointInPolygon⁡b,Q
outside
PointInPolygon⁡c,Q
boundary
PointInPolygon⁡Q1,Q
PointInPolygon⁡Array⁡a,Array⁡Q
PointInPolygon⁡Array⁡c,Array⁡Q
The ComputationalGeometry[PointInPolygon] command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
ComputationalGeometry[PointOrientation]
Download Help Document