MCPcopy Create free account
hub / github.com/cpaczek/skylight / vecToAzEl

Function vecToAzEl

shared/src/aim.ts:90–95  ·  view source on GitHub ↗
(v: Vec3)

Source from the content-addressed store, hash-verified

88
89/** ENU unit vector -> world az/el (degrees). */
90export function vecToAzEl(v: Vec3): { azDeg: number; elDeg: number } {
91 return {
92 azDeg: norm360(Math.atan2(v[0], v[1]) / DEG),
93 elDeg: Math.asin(Math.max(-1, Math.min(1, v[2]))) / DEG,
94 };
95}
96
97/** Great-circle angle between two look directions, degrees. */
98export function angularSepDeg(

Callers 2

worldFromMountFunction · 0.85
mountFromWorldFunction · 0.85

Calls 1

norm360Function · 0.70

Tested by

no test coverage detected