Closed
Description
Hi there,
I've been having some troubles with Ellipse.containsPoint
today. It doesn't seem to be working in 0.3.2. Same result in the latest of both chrome and firefox.
let ellipse = new toxi.geom.Ellipse(100, 100, 20, 50);
console.log(ellipse.containsPoint(new toxi.geom.Vec2D(100, 100)));
console.log(ellipse.containsPoint(new toxi.geom.Vec2D(110, 110)));
console.log(ellipse.containsPoint(new toxi.geom.Vec2D(90, 90)));
console.log(ellipse.containsPoint(new toxi.geom.Vec2D(100, 60)));
Output:
false
false
false
false
After calling toPolygon2D on that ellipse, and using the poly result the other hand:
let asPoly = ellipse.toPolygon2D(20);
console.log(asPoly.containsPoint(new toxi.geom.Vec2D(100, 100)));
console.log(asPoly.containsPoint(new toxi.geom.Vec2D(110, 110)));
console.log(asPoly.containsPoint(new toxi.geom.Vec2D(90, 90)));
console.log(asPoly.containsPoint(new toxi.geom.Vec2D(100, 60)));
Output:
true
true
true
true
Metadata
Metadata
Assignees
Labels
No labels