euclid.js
euclid.js copied to clipboard
Incorrect intersections when intersecting vertices
The following produces no intersections but seems like it should:
intersections(
new Circle( new Point(2, 3), 1),
new Polygon( new Point(2, 3), new Point(3, 3), new Point(3, 4), new Point(2, 4)
);
Intersections should be reported at 3, 3 and 2, 4. It seems that when the intersections occur at the polygon's vertices, they are not reported. Is this a bug or have I misunderstood how to use intersections? Thanks!
The Polygon.collision function appears to be marred by the same sort of issue. Collisions are not reported if the smaller polygon's vertices are along the larger polygon's edges.