mathWrapAngle

Wraps an angle to the range [-180, 180] degrees. Takes angle (angle in degrees). Returns the normalized angle in the range [-180, 180].

Mathematics

Parameters & Returns

Parameters

angle Double

Returns

Double

Quick Summary

Wraps an angle to the range [-180, 180] degrees. Takes angle (angle in degrees). Returns the normalized angle in the range [-180, 180].

Technical Exegesis...

Normalizes an angle in degrees to the range [-180, 180]. Angles outside this range are wrapped around.

Examples: mathWrapAngle(270) returns -90, mathWrapAngle(190) returns -170. Useful for ensuring angles are in a consistent range for comparisons and calculations.

Example

Example.bam
; No example implemented yet