Reputation: 41
So I have a list of points here.
private List<Point> points;
and the points class just has x,y,z values but only x,y are used in this case. So I store all the polygon points in there
and then I have this method here.
public Point getIntersection(Crossable aLine) {
}
And aLine is just two points so it has 4 values total for x1,x2,y1,y2 etc.
I want to get the intersection of the Line and the polygon, I have no understanding of how to get the intersection since there are a lot of variables involved and special cases. Any ideas?
Upvotes: 1
Views: 69
Reputation: 67
Consider every two adjacent points of the polygon as a line and check to see if it intersects with your line. You need a loop to go through them all.
Upvotes: 1