MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / everyPointInside

Function everyPointInside

graph-ui/src/galaxy/camera-frame.test.ts:269–281  ·  view source on GitHub ↗
(points: Vector3Like[], aspect = ASPECT)

Source from the content-addressed store, hash-verified

267
268 /** Die Zusicherung aus AC5, ueber jeden einzelnen Punkt. */
269 const everyPointInside = (points: Vector3Like[], aspect = ASPECT): number => {
270 const fit = fitCamera(points, FOV, aspect);
271 expect(fit).not.toBeNull();
272 let worst = 1;
273 for (const point of points) {
274 const seen = project(point, fit!, FOV, aspect);
275 expect(seen.z).toBeGreaterThan(0);
276 expect(Math.abs(seen.x)).toBeLessThanOrEqual(1);
277 expect(Math.abs(seen.y)).toBeLessThanOrEqual(1);
278 worst = Math.min(worst, 1 - Math.max(Math.abs(seen.x), Math.abs(seen.y)));
279 }
280 return worst;
281 };
282
283 it('haelt jeden Knoten im Bild, mit Rand, bei 76 Knoten', () => {
284 expect(everyPointInside(cloud(76, [900, 520, 140], 11))).toBeGreaterThan(0.02);

Callers 1

Calls 3

fitCameraFunction · 0.90
expectFunction · 0.85
projectFunction · 0.70

Tested by

no test coverage detected