(points: Vector3Like[], aspect = ASPECT)
| 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); |
no test coverage detected