
// angle_range.hpp - interface for manipulating angle ranges

#ifndef __angle_range_hpp__
#define __angle_range_hpp__

float normalizeAngle(float angle);  // normalize angle in radians to (-180,180) range.
float absoluteNormalizeAngle(float angle);  // absolute value of normalizeAngle

// isWithinRange returns true if angle theta is between the smaller arc formed by angles a & b. 
bool isWithinRange(float theta, float a, float b);

// isWithinOrientedRange returns true if angle theta is between a & b based on -1 or +1 winding.
bool isWithinOrientedRange(float theta, float a, float b, float winding);

// returns an angle representing theta clamped to the anglular range a & b based on -1 or +1 winding.
float clampToOrientedRange(float theta, float a, float b, float winding);

void test_isWithinRange();  // Regression testing

#endif // __angle_range_hpp__
