Download Tutorial C Files H Files

dg_get_radian

This function convert an angle in radian to fit in [-Pi; PI].

Usage

double dg_get_radian(double angle);

Example

dg_get_radian(5 * PI)

Source code

double dg_get_radian(double angle)
{
  while (angle > PI)
    angle -= 2 * PI;
  while (angle < -PI)
    angle += 2 * PI;
  return angle;
}