Diagonal of polygon is inside or outside?
Posted
by Himadri
on Stack Overflow
See other posts from Stack Overflow
or by Himadri
Published on 2010-05-12T06:55:57Z
Indexed on
2010/05/12
7:54 UTC
Read the original article
Hit count: 323
I have three consecutive points of polygon, say p1,p2,p3. Now I wanted to know whether the orthogonal between p1 and p3 is inside the polygon or outside the polygon.
I am doing it by taking three vectors v1,v2 and v3. And the point before the point p1 in polygon say p0.
v1 = (p0 - p1)
v2 = (p2 - p1)
v3 = (p3 - p1)
With reference to this question, I am using the method shown in the accepted answer of that question. It is only for counterclockwise. What if my points are clockwise.
I am also knowing my whole polygon is clockwise or counterclockwise. And accordingly I select the vectors v1 and v2. But still I am getting some problem. I am showing one case where I am getting problem.
This polygon is counterclockwise. and It is starting from the origin of v1 and v2.
© Stack Overflow or respective owner