in reply to Polygon Creation -- Request for Algorithm Suggestions
The simplest algorithm I'm aware of is to successively
The check is crucial, you need a scalar product of the point vector with orthogonal vectors on all edges pointing inside.
If the product is positiv it means the point is "inside" the edge.
Iff the point is inside all edges, it's inside the polygon.
Otherwise you extend the polygon by replacing all "outside" edges.
(Most probably you'll also need to move the points before doing the product, such that the edge goes thru (0,0) )
HTH and you get the idea.
I'm pretty tired, lacking the right vocabulary and typing into my mobile without possibility to scetch it on paper. :)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Polygon Creation -- Request for Algorithm Suggestions
by golux (Chaplain) on Nov 23, 2017 at 00:43 UTC | |
by LanX (Saint) on Nov 23, 2017 at 14:43 UTC | |
by LanX (Saint) on Nov 23, 2017 at 18:47 UTC | |
by LanX (Saint) on Nov 23, 2017 at 09:33 UTC |