Class Point


public class Point extends Object
A Point object represents an ordered pair of (x, y) coordinates in the 2D Cartesian plane.
  • Constructor Details

    • Point

      public Point()
  • Method Details

    • distance

      public double distance(Point p)
      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.