Here you can find the source of range(double[] min, double[] max, double[] min2, double[] max2)
public static double range(double[] min, double[] max, double[] min2, double[] max2)
//package com.java2s; //License from project: Open Source License public class Main { public static double range(double[] min, double[] max, double[] min2, double[] max2) { if (min == null || max == null || min2 == null || max2 == null) { return 0; }/*w ww . j a va2 s . c om*/ double d = 0; for (int i = 0; i < min.length; i++) { d += Math.abs(max[i] - max2[i]) + Math.abs(min[i] - min2[i]); } return d; } }