nyx_space::utils

Function between_pm_x

source
pub fn between_pm_x(angle: f64, x: f64) -> f64
Expand description

Returns the provided angle bounded between -x and +x.

This function takes an angle (in degrees) and normalizes it to the range [-x, x). If the angle is outside this range, it will be converted to an equivalent angle within this range. For example, if x is 180, an angle of 270 degrees will be converted to -90 degrees.

ยงArguments

  • angle - An angle in degrees.
  • x - The boundary for the angle normalization.