CrossingCount
✖
CrossingCount
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 allclose allBasic Examples (1)Summary of the most common use cases
Scope (3)Survey of the scope of standard use cases
Count how many times a ray starting from the point crosses the closed-curve contour:

https://wolfram.com/xid/0dqupcr75oy-6fpmk2

https://wolfram.com/xid/0dqupcr75oy-zsuhb5


https://wolfram.com/xid/0dqupcr75oy-3dno4m


https://wolfram.com/xid/0dqupcr75oy-ell501

https://wolfram.com/xid/0dqupcr75oy-4syxlc


https://wolfram.com/xid/0dqupcr75oy-4stb6a

Polygons with GeoGridPosition:

https://wolfram.com/xid/0dqupcr75oy-ipsiqu

https://wolfram.com/xid/0dqupcr75oy-yjciq7


https://wolfram.com/xid/0dqupcr75oy-cn3c0c

Applications (1)Sample problems that can be solved with this function
Color points based on the crossing count of a point in the given polygon:

https://wolfram.com/xid/0dqupcr75oy-51wvlh

https://wolfram.com/xid/0dqupcr75oy-yvi4jj

https://wolfram.com/xid/0dqupcr75oy-0v95f7

https://wolfram.com/xid/0dqupcr75oy-kzpu27

Properties & Relations (1)Properties of the function, and connections to other functions
WindingCount is an alternate count function:

https://wolfram.com/xid/0dqupcr75oy-0h89de

https://wolfram.com/xid/0dqupcr75oy-14smh2

Wolfram Research (2019), CrossingCount, Wolfram Language function, https://reference.wolfram.com/language/ref/CrossingCount.html.
Text
Wolfram Research (2019), CrossingCount, Wolfram Language function, https://reference.wolfram.com/language/ref/CrossingCount.html.
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.
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
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: 30-April-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: 30-April-2025
]}