calculates the distance between two {@link TPVObject} in kilometers<br>
the method used is the great-circle-distance with hypersine formula

@param tpv1 - position 1
@param tpv2 - position 2
@return distance in kilometers
975251
public static double getDistance(final TPVObject tpv1, final TPVObject tpv2) {
		return GISTool.getDistance(tpv1.getLongitude(), tpv2.getLongitude(), tpv1.getLatitude(), tpv2.getLatitude());
	}
436747
public static int distance (int x1, int y1, int x2, int y2) {
        return (int)Math.sqrt(distanceSq(x1, y1, x2, y2));
    }
1153957
def distance(p1, p2):
    
    R = 6371

    lat1, lon1 = p1
    lat2, lon2 = p2

    phi1 = radians(lat1)
    phi2 = radians(lat2)
    delta_lat = radians(lat2 - lat1)
    delta_lon = radians(lon2 - lon1)

    a = haversin(delta_lat) + cos(phi1) * cos(phi2) * haversin(delta_lon)
    return 2 * R * atan2(sqrt(a), sqrt(1 - a))
1334992
@Override
  public double distance(NumberVector v1, NumberVector v2) {
    if(v1.getDimensionality() != v2.getDimensionality()) {
      throw new IllegalArgumentException("Different dimensionality of FeatureVectors\n  " + "first argument: " + v1 + "\n  " + "second argument: " + v2);
    }

    double sqrDist = 0;
    for(int d = BitsUtil.nextSetBit(dimensions, 0); d >= 0; d = BitsUtil.nextSetBit(dimensions, d + 1)) {
      final double delta = v1.doubleValue(d) - v2.doubleValue(d);
      sqrDist += delta * delta;
    }
    return FastMath.sqrt(sqrDist);
  }
1349257
public double getSquaredDistance(final DBIDRef id1, final DBIDRef id2) {
    final int o1 = idmap.getOffset(id1), o2 = idmap.getOffset(id2);
    return kernel[o1][o1] + kernel[o2][o2] - 2 * kernel[o1][o2];
  }
1361179
function distance(p1, p2) {
        return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) +
                         (p1.y - p2.y) * (p1.y - p2.y));
    }
192177
public double distance(double p1, double p2) {
    double d = (p1 - p2) * (p1 - p2);
    return Math.sqrt(d);
  }
65107
public static function distance2(Vector $vector1, Vector $vector2) : float {
        $value = 0;
        $count = count($vector1);
        for ($i = 0;$i<$count;$i++) {
            $value += ($vector1[$i] - $vector2[$i]) * ($vector1[$i] - $vector2[$i]);
        }
        return $value;
    }
972639
public final double distance(E e1, E e2) {
    return distance(e1.getRoutingObjectID(), e2.getRoutingObjectID());
  }
380367
public static int distance (int x1, int y1, int x2, int y2)
    {
        int dx = x1-x2, dy = y1-y2;
        return (int)Math.sqrt(dx*dx+dy*dy);
    }
1258246
public int getManhattanDistance(Point2 that) {
    return Math.abs(x - that.x) + Math.abs(y - that.y);
  }
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);
    }
562372
@Pure
	public static boolean epsilonEqualsDistance(Point3D<?, ?> p1, Point3D<?, ?> p2) {
		final double distance = p1.getDistance(p2);
		return distance >= -distancePrecision && distance <= distancePrecision;
	}
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));
    }
36720
public float distance2(float tx, float ty) {
		float dx = tx - px;
		float dy = ty - py;
		
		return ((dx*dx) + (dy*dy));
	}
597127
def distance(vec1, vec2):
        """"""
        if isinstance(vec1, Vector2) \
                and isinstance(vec2, Vector2):
            dist_vec = vec2 - vec1
            return dist_vec.length()
        else:
            raise TypeError("vec1 and vec2 must be Vector2's")
172877
public float DistanceTo(IntPoint anotherPoint) {
        float dx = this.x - anotherPoint.x;
        float dy = this.y - anotherPoint.y;

        return (float) Math.sqrt(dx * dx + dy * dy);
    }