We have a line segment L defined by two points from polygon And a polygon p define with 4 or more digits, I need an algorithm that is L inside p ?
Edit: The line segment should be completely inside the polygon, if only partially it will be defined as outside
For example, the picture below: < / P>
Some other examples:
step 1 : Does it cross any side of L? If yes, LP is not in it. If not, see Step 2
Step 2 : Where is the middle of L? If the MP is inside, LP is inside.
In the case of bus:
Editing, more clarification : Two cases: at least one edge of LP Crosses. Then L at least partially drink.
No comments:
Post a Comment