docs: sync Task 8 test rewrite to hard-bound assertions

This commit is contained in:
sjat 2026-06-11 09:34:46 +02:00
parent 7614590b03
commit 31577787f1

View file

@ -972,7 +972,8 @@ and replace the `'beats a homography on barrel-distorted data'` test body's homo
const test: Vec2[] = [[488, 244], [1464, 732], [1952, 488], [976, 976]]; const test: Vec2[] = [[488, 244], [1464, 732], [1952, 488], [976, 976]];
const polyMax = Math.max(...test.map((m) => dist(applyPolyWarp(w, m), trueMap(m)))); const polyMax = Math.max(...test.map((m) => dist(applyPolyWarp(w, m), trueMap(m))));
const baseMax = Math.max(...test.map((m) => dist(applyPolyWarp(baseline, m), trueMap(m)))); const baseMax = Math.max(...test.map((m) => dist(applyPolyWarp(baseline, m), trueMap(m))));
expect(polyMax).toBeLessThan(baseMax * 0.05); expect(baseMax).toBeGreaterThan(1e-3); // affine baseline genuinely fails on barrel data
expect(polyMax).toBeLessThan(1e-6); // degree-3 fit of cubic data is near-exact everywhere
}); });
``` ```