wrap180 method

dynamic wrap180(
  1. dynamic degrees
)

Implementation

wrap180(var degrees) {
  if (-180<degrees && degrees <= 180)
    return degrees;
  return (degrees+540)%360-180;
}