fix: Use analytical Jacobian for curve intersection testing

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2025-09-22 18:33:28 +02:00
parent f55ecb96cc
commit bc3ce57e06
3 changed files with 101 additions and 82 deletions

View File

@@ -46,9 +46,11 @@ describe("Math curve", () => {
pointFrom(10, 50),
pointFrom(50, 50),
);
const l = lineSegment(pointFrom(0, 112.5), pointFrom(90, 0));
const l = lineSegment(pointFrom(10, -60), pointFrom(10, 60));
expect(curveIntersectLineSegment(c, l)).toCloselyEqualPoints([[50, 50]]);
expect(curveIntersectLineSegment(c, l)).toCloselyEqualPoints([
[9.99, 5.05],
]);
});
it("can be detected where the determinant is overly precise", () => {