From 5fb77e2bcd8a9abdd5d5d80098b3559f8731f984 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 23 Nov 2026 00:11:13 +0100 Subject: [PATCH] ridge runtime: view test pins the sign of the camera's sideways shift A mutant that flipped the offset's sin(phi) term survived: the phi 90 test read the shift by magnitude only. It now requires the shift to the left for a camera clockwise of the heading and to the right for the other side. Co-Authored-By: Claude Sonnet 5.5 --- src/app/features/scene/ridge/view.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/features/scene/ridge/view.test.ts b/src/app/features/scene/ridge/view.test.ts index 6eddebe6..f50191fa 100644 --- a/src/app/features/scene/ridge/view.test.ts +++ b/src/app/features/scene/ridge/view.test.ts @@ -102,6 +102,9 @@ describe('cardPose', () => { // The sideways part of a pose: where the line meets the heading's own column, a0 = shift / k + s (h - rest). const a0 = (q: { scale: number; shiftPx: number }) => q.shiftPx / k + q.scale * (135 - rest); expect(a0(at(0))).toBeCloseTo(0, 6); + // A camera to the clockwise side of the heading (east of a north view) sees the card to the left of it, and one on the other side to the right. + expect(a0(p)).toBeLessThan(0); + expect(a0(at(-90))).toBeGreaterThan(0); // r / R x 57.3 degrees at the heading's own column; the line fitted over the arc takes the mean of cos over it, about 0.93 of that. const centre = (200 / 12000) * (180 / Math.PI); expect(Math.abs(a0(p)) / centre).toBeGreaterThan(0.9);