MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / disc

Function disc

src/utils/cameraUndistortion.test.ts:16–26  ·  view source on GitHub ↗

Sample normalized points on a disc of the given radius.

(radius: number, rings = 5, spokes = 8)

Source from the content-addressed store, hash-verified

14
15/** Sample normalized points on a disc of the given radius. */
16function 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
28function maxRoundTripError(modelId: CameraModelId, intrins: CameraIntrinsics, pts: Vec2[]): number {
29 let max = 0;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected