normalizeRotation static method

double normalizeRotation(
  1. double rotation
)

Normalize an angle to the range [0, 360).

Implementation

static double normalizeRotation(double rotation) {
  double normalized = rotation % 360;
  return normalized < 0 ? normalized + 360 : normalized;
}