code: public static double Manhattan(double[] p, double[] q) {
          double sum = 0;
          for (int i = 0; i < p.length; i++) {
              sum += Math.abs(p[i] - q[i]);
          }
          return sum;
      }
docs: Gets the Manhattan distance between two points.
  
  @param p A point in space.
  @param q A point in space.
  @return The Manhattan distance between x and y.