bearingToAzimuth function Null safety

num bearingToAzimuth(
  1. num bearing
)

Implementation

num bearingToAzimuth(num bearing) {
  num angle = bearing.remainder(360);
  if (angle < 0) {
    angle += 360;
  }
  return angle;
}