List of utility methods to do Distance Calculate
double | distance(double u, double v, double pu, double pv) Returns the distance from point u,v to point pu,pv double du = pu - u; double dv = pv - v; dv = dv * dv; du = du * du; return Math.sqrt(dv + du); |
double | distance(double w1, double h1, double w2, double h2, int type) Determina a distancia entre dois pixels if (type == 1) { return Math.sqrt(Math.pow(w1 - w2, 2) + Math.pow(h1 - h2, 2)); } else if (type == 2) { return Math.abs(w1 - w2) + Math.abs(h1 - h2); } else { return Math.max(Math.abs(w1 - w2), Math.abs(h1 - h2)); |
double | distance(double x, double y, double xx, double yy) Calculate the Pythagorean distance from (x, y) to (xx, yy) double dx = xx - x; double dy = yy - y; return Math.sqrt(dx * dx + dy * dy); |
double | distance(double x0, double y0, double x1, double y1) distance return Math.sqrt(distanceSquared(x0, y0, x1, y1));
|
double | distance(double x0, double y0, double z0, double x1, double y1, double z1) distance return Math.sqrt(distanceSq(x0, y0, z0, x1, y1, z1));
|
double | distance(double x1, double y1, double x2, double y2) distance double lat1 = Math.PI / 180.0 * x1; double lat2 = Math.PI / 180.0 * x2; double dLng = Math.PI / 180.0 * (y2 - y1); double R = 3958.760; return Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos(dLng)) * R; |
double | distance(double x1, double y1, double x2, double y2) distance return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
|
double | distance(double x1, double y1, double x2, double y2) distance return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
|
double | distance(double x1, double y1, double z1, double x2, double y2, double z2) distance return Math.pow(Math.pow((x2 - x1), 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2), 0.5);
|
double | distance(double xOrigin, double yOrigin, double xDestination, double yDestination) distance double offsetX = xDestination - xOrigin; double offsetY = yDestination - yOrigin; return Math.sqrt(offsetX * offsetX + offsetY * offsetY); |