CrossingCount[contour,p]
给出从点 p 开始的射线穿过闭合曲线 contour 的次数.
CrossingCount
CrossingCount[contour,p]
给出从点 p 开始的射线穿过闭合曲线 contour 的次数.
更多信息和选项
- CrossingCount 亦称为交叉数.
- CrossingCount 通常用于确定应一个点是否被包含在多边形中.
- 如果闭合曲线 contour 是自相交的,CrossingCount[contour,p] 给出从点 p 开始的所有射线中穿过曲线最少的次数.
- 闭合曲线 contour 通常是一组线段 Line[{{p1,p2},…,{pn-1,pn},{pn,p1}}],且必须位于一个平面上.
范例
打开所有单元 关闭所有单元基本范例 (1)
范围 (3)
ℛ = Line[{{1, 0}, {0, 2}, {-1, 0}, {0, 1}, {1, 0}}];CrossingCount[ℛ, {0, 1 / 2}]Graphics[{ℛ, Red, Point[{0, 1 / 2}]}]ℛ = Polygon[{{0.35, 0.2}, {0.9, 0.75}, {0.1, 0.55}, {0.9, 0.35}, {0.42, 0.9}}, {1, 2, 3, 4, 5}];CrossingCount[ℛ, {0.5, 0.7}]Graphics[{ℛ, Red, Point[{0.5, 0.7}]}]具有 GeoGridPosition 的多边形:
ℛ = Polygon[GeoGridPosition[{{{-0.9950503945490105, 1.2366760550756015},
{-0.9952074890903578, 1.2369207053693891}, {-0.9952196732768064, 1.2369073327446167},
{-0.9953160063787643, 1.236848436956935}, {-0.9954141759436825, 1.2369993898475449},
{-0. ... 197645333103}, {-0.9949098578570917, 1.2368130881428654},
{-0.9948663952535768, 1.2367477711687371}, {-0.9948714472169538, 1.2367426500757825},
{-0.9949211061652593, 1.2367089232486177}, {-0.9949439717990124, 1.236746107097628}}}, "Bonne"]];CrossingCount[ℛ, {-0.995, 1.237}]Region[ℛ, Epilog -> {Red, Point[{-0.995, 1.237}]}]应用 (1)
ℛ = DynamicModule[«3»];points = RandomReal[{0, 1}, {8000, 2}];counts = CrossingCount[ℛ, points];Graphics[{AbsolutePointSize[1], Point[points, VertexColors -> {Green, Blue, Red}[[counts + 1]] ]}]属性和关系 (1)
WindingCount 是另一个计数函数:
contour = Line[{{0.35, 0.2}, {0.42, 0.9}, {0.9, 0.35}, {0.1, 0.55}, {0.9, 0.75}, {0.35, 0.2}}];{WindingCount[contour, {0.5, 0.5}], CrossingCount[contour, {0.5, 0.5}]}文本
Wolfram Research (2019),CrossingCount,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CrossingCount.html.
CMS
Wolfram 语言. 2019. "CrossingCount." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/CrossingCount.html.
APA
Wolfram 语言. (2019). CrossingCount. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CrossingCount.html 年
BibTeX
@misc{reference.wolfram_2026_crossingcount, author="Wolfram Research", title="{CrossingCount}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CrossingCount.html}", note=[Accessed: 15-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_crossingcount, organization={Wolfram Research}, title={CrossingCount}, year={2019}, url={https://reference.wolfram.com/language/ref/CrossingCount.html}, note=[Accessed: 15-September-2026]}