Function swri_math_util::unWrapAngle

Function Documentation

double swri_math_util::unWrapAngle(double static_angle, double variable_angle, double threshold = _pi)

Unwraps the variable_angle across 0-2pi or +/-pi boundaries to avoid large differences between the static and variable angles (when the difference may be small. For example a static angle of 2pi - epsilon and a variable angle of epsilon would result in the variable angle being unwrapped to 2pi + epsilon.

Parameters:
  • static_angle[in] The reference angle

  • variable_angle[in] The angle to unwrap

  • threshold[in] A threshold on the angle (default is pi)

Return values:

Returns – the resultant angle