CrossingCount

CrossingCount[contour,p]

gives a count of the number of times a ray starting from the point p crosses the closed curve contour.

Details

  • CrossingCount is also known as crossing number.
  • CrossingCount is typically used to determine the inclusion of a point in a polygon.
  • If the closed curve contour is selfintersecting, CrossingCount[contour,p] gives the minimal count among all rays starting from the point p.
  • The closed curve contour is typically a collection of line segments Line[{{p1,p2},,{pn-1,pn},{pn,p1}}] and must lie in a plane.

Examples

open all close all

Basic Examples  (1)

Count how many times a ray starting from the point crosses the closed-curve contour:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Scope  (2)

Applications  (1)

Properties & Relations  (1)

Introduced in 2019
(12.0)