Skip to content

Function: clampedAcosDeg()

clampedAcosDeg(dot): number

Defined in: packages/core/src/ui/follow.ts:24

Angle in degrees from the dot product of two unit vectors, robust to floating-point error. A normalized dot product can land slightly outside [-1, 1] (e.g. 1.0000001), which makes Math.acos return NaN; that NaN would then poison the follow re-target comparison. Clamp before acos.

Parameters

dot

number

Returns

number

Privacy | Terms