Ray-casting algorithm: Difference between revisions
m
Small grammar change.
(→{{header|Perl 6}}: add entry) |
m (Small grammar change.) |
||
Line 18:
An intuitive explanation of why it works is that every time we cross
a border, we change "country" (inside-outside, or outside-inside), but
the last "country" we land on is surely ''outside'' (since the inside of the polygon is finite, while the ray continues towards infinity). So, if we crossed an odd number of borders we
So the main part of the algorithm is how we determine if a ray intersects a segment. The following text explain one of the possible ways.
|