ellipse and arc refactors

This commit is contained in:
Mark Tolmacs 2024-09-25 11:03:35 +02:00
parent 3efa8735ef
commit 392dd5b0b8
No known key found for this signature in database
9 changed files with 125 additions and 94 deletions

View file

@ -6,7 +6,7 @@ describe("point on arc", () => {
it("should detect point on simple arc", () => {
expect(
isPointOnSymmetricArc(
arc(1, radians(-Math.PI / 4), radians(Math.PI / 4)),
arc(point(0, 0), 1, radians(-Math.PI / 4), radians(Math.PI / 4)),
point(0.92291667, 0.385),
),
).toBe(true);
@ -14,7 +14,7 @@ describe("point on arc", () => {
it("should not detect point outside of a simple arc", () => {
expect(
isPointOnSymmetricArc(
arc(1, radians(-Math.PI / 4), radians(Math.PI / 4)),
arc(point(0, 0), 1, radians(-Math.PI / 4), radians(Math.PI / 4)),
point(-0.92291667, 0.385),
),
).toBe(false);
@ -22,7 +22,7 @@ describe("point on arc", () => {
it("should not detect point with good angle but incorrect radius", () => {
expect(
isPointOnSymmetricArc(
arc(1, radians(-Math.PI / 4), radians(Math.PI / 4)),
arc(point(0, 0), 1, radians(-Math.PI / 4), radians(Math.PI / 4)),
point(-0.5, 0.5),
),
).toBe(false);