Angular distance
Shortest angular distance between two angles, in radians (always positive):
// https://gamedev.stackexchange.com/a/4472
float delta_angle(float a0, float a1)
{
return M_PI - fabs(fabs(a1 - a0) - M_PI);
}
Shortest angular distance between two angles, in radians (always positive):
// https://gamedev.stackexchange.com/a/4472
float delta_angle(float a0, float a1)
{
return M_PI - fabs(fabs(a1 - a0) - M_PI);
}