Here you can find the source of distanceInf(double[] p1, double[] p2)
Parameter | Description |
---|---|
p1 | the p1 |
p2 | the p2 |
public static double distanceInf(double[] p1, double[] p2)
//package com.java2s; public class Main { /**/* w ww . ja v a 2 s. c om*/ * Distance inf. * * @param p1 the p1 * @param p2 the p2 * @return the double */ public static double distanceInf(double[] p1, double[] p2) { double max = 0; for (int i = 0; i < p1.length; i++) { max = Math.max(max, Math.abs(p1[i] - p2[i])); } return max; } /** * Distance inf. * * @param p1 the p1 * @param p2 the p2 * @return the int */ public static int distanceInf(int[] p1, int[] p2) { int max = 0; for (int i = 0; i < p1.length; i++) { max = Math.max(max, Math.abs(p1[i] - p2[i])); } return max; } }