code: static int wrappedDistance(int i0, int i1, int size)
      {
          int w0 = wrap(i0, size);
          int w1 = wrap(i1, size);
          int d = Math.abs(w1-w0);
          return Math.min(d, size-d);
      }
docs: Computes the distance (absolute difference) between the given values
  when they are interpreted as points on a circle with the given
  size (that is, circumference). <br>
  <br>
  E.g. <br>
  <pre><code>
  wrappedDistance(0,  9, 10) = 1
  wrappedDistance(0, 10, 10) = 0
  wrappedDistance(0, 11, 10) = 1
  wrappedDistance(1, -4, 10) = 5
  </code></pre>
  
  @param i0 The first value
  @param i1 The second value
  @param size The wrapping size
  @return The wrapped distance