/** * Computes the distance to the given Point. * * @param other - second Point * @throws IllegalArgumentException */ public double distanceTo(Point other) { if (other == null) { throw new IllegalArgumentException("The second Point cannot be null."); } return distance(this.x, this.y, other.x, other.y); }
/** * Computes the distance to the given Point. * * @param other - second Point * @throws IllegalArgumentException */ public double distanceTo(Point other) { if (other == null) { throw new IllegalArgumentException("The second Point cannot be null."); } return distance(this.x, this.y, other.x, other.y); }