Sample normalized points on a disc of the given radius.
(radius: number, rings = 5, spokes = 8)
| 14 | |
| 15 | /** Sample normalized points on a disc of the given radius. */ |
| 16 | function disc(radius: number, rings = 5, spokes = 8): Vec2[] { |
| 17 | const pts: Vec2[] = [{ x: 0, y: 0 }]; |
| 18 | for (let i = 1; i <= rings; i++) { |
| 19 | const r = (radius * i) / rings; |
| 20 | for (let j = 0; j < spokes; j++) { |
| 21 | const a = (2 * Math.PI * j) / spokes; |
| 22 | pts.push({ x: r * Math.cos(a), y: r * Math.sin(a) }); |
| 23 | } |
| 24 | } |
| 25 | return pts; |
| 26 | } |
| 27 | |
| 28 | function maxRoundTripError(modelId: CameraModelId, intrins: CameraIntrinsics, pts: Vec2[]): number { |
| 29 | let max = 0; |
no outgoing calls
no test coverage detected