docs: private static double normalize(double v, double range) {
          double a = v-Math.floor((v + (range/2))/range)*range;
          // Make sure that a and v have the same sign
          // when abs(v) = 180.
          if (Math.abs(a) == 180.0 && (a * v) < 0) {
              a *= -1;
          }
          // The addition of 0.0 is to avoid negative
          // zero, which just confuses things.
          return a + 0.0;
      }