to check wether the give point is inside a ploygon
Hi all ,
I want to implement a draggable polygon in java I was able to Implement for a line and for a box . For a polygon the set of values we take are not constant and the shape is also irregular to deside too .
Can any one send me java code or snippet how to implement it .
Thanks in advance
raghavan
# 2
Just for fun, I was thinking about an algorithm to do this. Here's what I came up with... I think it's the right answer but you tell me
Basically, in a polygon, you have n vertices and n - 1 sides. Since the sides actually define the polygon, all you need to do is find out what side of each of the sides the point lies on, and make sure that its on the inside side for each chord.
Is this correct?
# 5
Search your computer for src.zip, here's a tip:
It will be in the Java installation folder.
Don't ask me why they put it there, they were probably just trying to be clever.
So, don't worry if you couldn't figure out where it would be, because it's obviously not in an obvious spot.