sanitizeDegreesDouble method Null safety

double sanitizeDegreesDouble(
  1. double degrees
)

Sanitizes a degree measure as a floating-point number.

Returns a degree measure between 0.0 (inclusive) and 360.0 (exclusive).

Implementation

static double sanitizeDegreesDouble(double degrees) {
  degrees = degrees % 360.0;
  if (degrees < 0) {
    degrees = degrees + 360.0;
  }
  return degrees;
}