normalizeDegree static method

double normalizeDegree(
  1. double degree
)

Normalizes degree to 0-360

Implementation

static double normalizeDegree(double degree) {
  var degreeNormalized = 360 % degree;
  if (degreeNormalized < 0) {
    degreeNormalized = 360 + degreeNormalized;
  }
  return degreeNormalized;
}