# CrossingPolygon

CrossingPolygon[{p1,p2,,pn}]

gives a Polygon representing all points for which a ray from the point in any direction in the plane crosses the line segments {p1,p2},,{pn-1,pn},{pn,p1} an odd number of times.

CrossingPolygon[{{p11,p12,},{p21,p22,},}]

gives a Polygon from the line segments {p11,p12},,{p21,p22},.

# Details and Options • CrossingPolygon is also known as evenodd filling rule.
• A point is in CrossingPolygon if a ray starting at that point to infinity in any direction will cross the boundary curves an odd number of times. The number of ray crossings is given by CrossingCount.
• The number of ray crossings is given below for each region.
• • CrossingPolygon is used to define a polygon from possibly self-intersecting closed curves.
• • CrossingPolygon[{p1,p2,,pn}] is effectively equivalent to Polygon[{p1,p2,,pn}].
• CrossingPolygon[{{p11,p12,},{p21,p22,},}] is, in general, different than Polygon[{{p11,p12,},{p21,p22,},}] since the former will use the ray crossing rule for all closed curves {pi1,pi2,}. The latter is the union of polygons Polygon[{pi1,pi2,}].
• • The points pi can have any length but must all lie in a plane.
• CrossingPolygon takes the same options as Polygon.

# Examples

open all close all

## Basic Examples(2)

Define a polygon:

 In:= Out= In:= Out= Construct a polygon from a self-intersecting contour:

 In:= Out= Compute its area:

 In:= Out= ## Neat Examples(1)

Introduced in 2019
(12.0)