Class Point
java.lang.Object
Point
A Point object represents an ordered pair of
(x, y) coordinates in the 2D Cartesian plane.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Point
public Point()
-
-
Method Details
-
distance
Computes and returns the distance between this point and the given other point.- Parameters:
p- The point to which the distance is computed.- Returns:
- The distance, computed as the square root of the sums of the squares of the differences between the two points' x-coordinates (dx) and between their y-coordinates (dy).
- Throws:
NullPointerException- if p is null.
-