Get the squared euclidean distance from two points of arbitrary, but equal, dimensions
@param {Array} point1
@param {Array} point2
@returns {number} Squared euclidean distance
180080
function squaredEuclideanDistance (point1, point2) {
    var result = 0,
        i = 0;

    for (; i < point1.length; i++) {
        result += Math.pow(point1[i] - point2[i], 2);
    }

    return result;
}
942928
function getDistance(touch1, touch2) {
    var x = touch2.clientX - touch1.clientX,
        y = touch2.clientY - touch1.clientY;

    return Math.sqrt((x * x) + (y * y));
  }
374049
public static double Euclidean(double x1, double y1, double x2, double y2) {
        double dx = Math.abs(x1 - x2);
        double dy = Math.abs(y1 - y2);

        return Math.sqrt(dx * dx + dy * dy);
    }
590313
@Pure
	public double distance(Point2D<?, ?> point) {
		assert point != null;
		final GeoLocationPoint p = getGeoPosition();
		if (p != null) {
			return Point2D.getDistancePointPoint(p.getX(), p.getY(), point.getX(), point.getY());
		}
		return Double.NaN;
	}
772585
def get_v_distance(self, latlonalt1, latlonalt2):
        ''''''
        (lat1, lon1, alt1) = latlonalt1
        (lat2, lon2, alt2) = latlonalt2
        return alt2 - alt1
480352
public int compare(Point2D other) {
		return y < other.y ? -1 : (y > other.y ? 1 : (x < other.x ? -1
				: (x > other.x ? 1 : 0)));
	}
1316612
function(p1, p2) {
		_tempPoint.x = Math.abs( p1.x - p2.x );
		_tempPoint.y = Math.abs( p1.y - p2.y );
		return Math.sqrt(_tempPoint.x * _tempPoint.x + _tempPoint.y * _tempPoint.y);
	}
815027
protected double sqDist(double[] v1, double[] v2) {
    assert (v1.length == v2.length) : "Lengths do not agree: " + v1.length + " " + v2.length;
    double sum = 0;
    for(int i = 0; i < v1.length; i++) {
      final double diff = v1[i] - v2[i];
      sum += diff * diff;
    }
    ++projectedDistances;
    return sum;
  }
979878
function (point1, point2, y) {
  let f1 = y - point1[1]
  let f2 = point2[1] - point1[1]
  if (f2 < 0) {
    f1 = -f1
    f2 = -f2
  }
  let t
  if (f1 <= 0) {
    t = 0.0
  } else if (f1 >= f2) {
    t = 1.0
  } else if (f2 < 1e-10) { // FIXME Should this be CSG.EPS?
    t = 0.5
  } else {
    t = f1 / f2
  }
  let result = point1[0] + t * (point2[0] - point1[0])
  return result
}
1121842
public float distance(DataPoint point) {
        switch (functionName) {
            case "euclidean":
                float ret = Nd4j.getExecutioner().execAndReturn(new EuclideanDistance(this.point, point.point))
                                .getFinalResult().floatValue();
                return invert ? -ret : ret;

            case "cosinesimilarity":
                float ret2 = Nd4j.getExecutioner().execAndReturn(new CosineSimilarity(this.point, point.point))
                                .getFinalResult().floatValue();
                return invert ? -ret2 : ret2;

            case "manhattan":
                float ret3 = Nd4j.getExecutioner().execAndReturn(new ManhattanDistance(this.point, point.point))
                                .getFinalResult().floatValue();
                return invert ? -ret3 : ret3;
            case "dot":
                float dotRet = (float) Nd4j.getBlasWrapper().dot(this.point, point.point);
                return invert ? -dotRet : dotRet;
            default:
                float ret4 = Nd4j.getExecutioner().execAndReturn(new EuclideanDistance(this.point, point.point))
                                .getFinalResult().floatValue();
                return invert ? -ret4 : ret4;

        }
    }
121480
def calculate_a1 point
      distances = []
      main_cluster.points.each do |point1|
        distances << euclidean_distance(point, point1).round(2)
      end
      return 0 if distances.size == 1
      (distances.inject(:+)/(distances.size - 1)).round(2)
    end
503453
public static double euclidean(EuclideanCoordinate coord1, EuclideanCoordinate coord2) {
		int size = Math.min(coord1.dimensions(), coord2.dimensions());
		double distance = 0;
		for(int i = 0; i < size; i++) {
			double diff = coord1.get(i) - coord2.get(i);
			distance += diff * diff;
		}
		distance = Math.sqrt(distance);
		return distance;
	}
725577
def point_distance_ellipsode(point1,point2):
    
    a = 6378137
    f = 1/298.25722
    b = a - a*f
    e = math.sqrt((a*a-b*b)/(a*a))
    lon1 = point1['coordinates'][0]
    lat1 = point1['coordinates'][1]
    lon2 = point1['coordinates'][0]
    lat2 = point2['coordinates'][1]
    M = a*(1-e*e)*math.pow(1-math.pow(e*math.sin(number2radius(lat1)),2),-1.5)
    N = a/(math.pow(1-math.pow(e*math.sin(number2radius(lat1)),2),0.5))
    
    distance_lat = M*number2radius(lat2-lat1)
    distance_lon = N*math.cos(number2radius(lat1))*(lon2-lon1)*3600*math.sin(1/3600*math.pi/180)
    return math.sqrt(distance_lat*distance_lat+distance_lon*distance_lon)
915275
public static Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2) {
        Point3d point1 = atom1.getPoint3d();
        double d1 = atom1.getCovalentRadius();
        double d2 = atom2.getCovalentRadius();
        // in case we have no covalent radii, set to 1.0
        double distance = (d1 < 0.1 || d2 < 0.1) ? 1.0 : atom1.getCovalentRadius() + atom2.getCovalentRadius();
        Vector3d vect = new Vector3d(point2);
        vect.sub(point1);
        vect.normalize();
        vect.scale(distance);
        Point3d newPoint = new Point3d(point1);
        newPoint.add(vect);
        return newPoint;
    }
1112107
public static double getDistance(double x1, double y1, double x2, double y2)
    {
        final double x = x2 - x1;
        final double y = y2 - y1;

        return StrictMath.sqrt(x * x + y * y);
    }
398822
def points_distance(x1, y1, x2, y2)
      Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
    end
969158
def distance(p1, p2):
    

    def xyz(some_pose):
        if isinstance(some_pose, PoseStamped):
            return some_pose.pose.position.x, some_pose.pose.position.y, some_pose.pose.position.z
        elif isinstance(some_pose, Pose):
            return some_pose.position.x, some_pose.position.y, some_pose.position.z
        elif _is_indexable(some_pose[0]):
            return some_pose[0][0], some_pose[0][1], some_pose[0][2]
        else:
            return some_pose[0], some_pose[1], some_pose[2]

    x1, y1, z1 = xyz(p1)
    x2, y2, z2 = xyz(p2)

    x = x1 - x2
    y = y1 - y2
    z = z1 - z2
    return sqrt(x * x + y * y + z * z)