Get the distance from this point to another, squared. This
can sometimes be used in place of distance and avoids the
additional sqrt.

@param other The other point we're measuring to
@return The distance to the other point squared
10171
public float distanceSquared(Vector2f other) {
		float dx = other.getX() - getX();
		float dy = other.getY() - getY();
		
		return (float) (dx*dx)+(dy*dy);
	}
203373
private static double pointsDistance(Point a, Point b) {
        int dx = b.x - a.x;
        int dy = b.y - a.y;
        return Math.sqrt(dx * dx + dy * dy);
    }
607712
private double distance(double[] center, double[] center2) {
		double d = 0D;
		for (int i = 0; i < center.length; i++) {
			d += Math.pow((center[i] - center2[i]), 2);
		}
		return Math.sqrt(d);
	}
1237599
def distance(self, other):
        
        return distance(self.lat, self.lon, None, other.lat, other.lon, None)
72964
public double normalizedDistance(double[] point1, double[] point2) throws Exception {
    return Math.sqrt(distance2(point1, point2)) / point1.length;
  }
282495
def get_distance_between_two_points(self, one, two):
        """"""
        dx = one.x - two.x
        dy = one.y - two.y
        return math.sqrt(dx * dx + dy * dy)
415267
public static double distance(Point p1, Point p2)
	{
		double x = p2.x - p1.x;
		double y = p2.y - p1.y;
		double z = p2.z - p1.z;
		return Math.sqrt(x * x + y * y + z * z);
	}
1227270
public double sqrDistance(Envelope2D other)
	{
		double dx = 0;
		double dy = 0;
		double nn;

		nn = xmin - other.xmax;
		if (nn > dx)
			dx = nn;

		nn = ymin - other.ymax;
		if (nn > dy)
			dy = nn;

		nn = other.xmin - xmax;
		if (nn > dx)
			dx = nn;

		nn = other.ymin - ymax;
		if (nn > dy)
			dy = nn;

		return dx * dx + dy * dy;
	}
12464
public double angleTo(LineSegment other) {
        double angle1 = Math.atan2(this.start.y - this.end.y, this.start.x - this.end.x);
        double angle2 = Math.atan2(other.start.y - other.end.y, other.start.x - other.end.x);
        double angle = Math.toDegrees(angle1 - angle2);
        if (angle <= -180) {
            angle += 360;
        }
        if (angle >= 180) {
            angle -= 360;
        }
        return angle;
    }
380256
def distance_to(self, other):
        
        if self.overlaps(other):
            return 0
        try:
            if self.begin < other.begin:
                return other.begin - self.end
            else:
                return self.begin - other.end
        except:
            if self.end <= other:
                return other - self.end
            else:
                return self.begin - other
221202
public static double distance(Coordinate c1, Coordinate c2) {
		double a = c1.getX() - c2.getX();
		double b = c1.getY() - c2.getY();
		return Math.sqrt(a * a + b * b);
	}
1060348
private double distance(Instance inst1, double[] inst2){
        double distance = 0.0;
        for (int i = 0; i < numDims; i++) {
            double d = inst1.value(i) - inst2[i];
            distance += d * d;
        }
        return Math.sqrt(distance);
    }
769587
public static float distance(PointF p1, PointF p2){
        return (float) Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow(p2.y - p1.y,2));
    }
6967
@Pure
	public double distanceSquaredSegment(Point3D point) {
		return distanceSquaredSegmentPoint(
				getX1(), getY1(), getZ1(),
				getX2(), getY2(), getZ2(),
				point.getX(), point.getY(), point.getZ());
	}
1181367
public static Double getDistanceWithinThresholdOfCoordinates(
            Tuple2<Double, Double> point1, Tuple2<Double, Double> point2) {
        throw new NotImplementedError();
    }
207673
public static double distance(double[] pointA, double[] pointB, int offsetB) {
		return Math.sqrt(distanceSquared(pointA, pointB, offsetB));
	}
1019031
public Double haversine(Position other) {
		double lon0r = toRadians(this.longitude);
		double lat0r = toRadians(this.latitude);
		double lon1r = toRadians(other.longitude);
		double lat1r = toRadians(other.latitude);
		double a = pow(sin((lat1r - lat0r) / 2.0), 2);
		double b = cos(lat0r) * cos(lat1r) * pow(sin((lon1r - lon0r) / 2.0), 2);

		return 6371000.0 * 2 * asin(sqrt(a + b));
	}