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 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 allclose all

Basic Examples  (1)

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

Scope  (3)

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

Polygon boundary curves:

Polygons with GeoGridPosition:

Applications  (1)

Color points based on the crossing count of a point in the given polygon:

Properties & Relations  (1)

WindingCount is an alternate count function:

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.

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_2024_crossingcount, author="Wolfram Research", title="{CrossingCount}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CrossingCount.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_crossingcount, organization={Wolfram Research}, title={CrossingCount}, year={2019}, url={https://reference.wolfram.com/language/ref/CrossingCount.html}, note=[Accessed: 22-November-2024 ]}