code: @Override
      public double distance( Object pt1, Object pt2 ) {
          double[] coords1 = coords(pt1);
          double[] coords2 = coords(pt2);
          double sum = 0.0;
          for( int i = 0; i < dimensions; i++ ) {
              double d = coords1[i] - coords2[i];
              sum += d * d;
          }
          return Math.sqrt(sum);
      }
docs: optimizations