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


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 and Options

- 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 self‐intersecting, 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 allBasic Examples (1)
Scope (3)
Count how many times a ray starting from the point crosses the closed-curve contour:
Polygons with GeoGridPosition:
Properties & Relations (1)
WindingCount is an alternate count function:
History
Text
Wolfram Research (2019), CrossingCount, Wolfram Language function, https://reference.wolfram.com/language/ref/CrossingCount.html.
CMS
Wolfram Language. 2019. "CrossingCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CrossingCount.html.
APA
Wolfram Language. (2019). CrossingCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CrossingCount.html
BibTeX
@misc{reference.wolfram_2025_crossingcount, author="Wolfram Research", title="{CrossingCount}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CrossingCount.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_crossingcount, organization={Wolfram Research}, title={CrossingCount}, year={2019}, url={https://reference.wolfram.com/language/ref/CrossingCount.html}, note=[Accessed: 11-August-2025]}