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

Function _glslDivision

src/shaders/undistortion.ts:887–893  ·  view source on GitHub ↗
(p: Vec2, i: CameraIntrinsics)

Source from the content-addressed store, hash-verified

885
886// Mirrors distortDivision().
887function _glslDivision(p: Vec2, i: CameraIntrinsics): Vec2 {
888 const rho2 = p.x * p.x + p.y * p.y;
889 const disc2 = 1.0 - 4.0 * rho2 * i.kDiv;
890 if (disc2 < 0.0) return { x: p.x, y: p.y }; // disc2 < 0 → GLSL delta = vec2(0) → distorted = p
891 const r = 2.0 / (1.0 + Math.sqrt(disc2));
892 return { x: p.x * r, y: p.y * r };
893}
894
895// Mirrors distortEUCM().
896function _glslEUCM(p: Vec2, i: CameraIntrinsics): Vec2 {

Callers 1

glslForwardReferenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected