/** * @param x * @param y * @return the distance between the point described by this vector and the given x, y point. */ @Override public double distance(final double x, final double y) { return MathUtils.sqrt(distanceSquared(x, y)); }
/** * @param x * @param y * @return the distance between the point described by this vector and the given x, y point. */ @Override public double distance(final double x, final double y) { return MathUtils.sqrt(distanceSquared(x, y)); }
/** * @param destination * @return the distance between the point described by this vector and the given destination point. * @throws NullPointerException * if destination is null. */ @Override public double distance(final ReadOnlyVector2 destination) { return MathUtils.sqrt(distanceSquared(destination)); }
/** * @param destination * @return the distance between the point described by this vector and the given destination point. * @throws NullPointerException * if destination is null. */ @Override public double distance(final ReadOnlyVector2 destination) { return MathUtils.sqrt(distanceSquared(destination)); }
/** * @param destination * @return the squared distance between the point described by this vector and the given destination point. When * comparing the relative distance between two points it is usually sufficient to compare the squared * distances, thus avoiding an expensive square root operation. * @throws NullPointerException * if destination is null. */ @Override public double distanceSquared(final ReadOnlyVector2 destination) { return distanceSquared(destination.getX(), destination.getY()); }
/** * @param destination * @return the squared distance between the point described by this vector and the given destination point. When * comparing the relative distance between two points it is usually sufficient to compare the squared * distances, thus avoiding an expensive square root operation. * @throws NullPointerException * if destination is null. */ @Override public double distanceSquared(final ReadOnlyVector2 destination) { return distanceSquared(destination.getX(), destination.getY()); }