// This client program constructs three points by calling constructors, // translates two of the points, prints them, and then reports the distance // between two of them. public class PointTest3 { public static void main(String[] args) { Point p1 = new Point(3, 5); Point p2 = new Point(12, 4); Point p3 = new Point(); p1.translate(11, 6); p2.translate(6, 8); System.out.println("p1 distance = " + p1.distanceFromOrigin()); System.out.println("p2 distance = " + p2.distanceFromOrigin()); System.out.println("p1 = " + p1); System.out.println("p2 = " + p2); System.out.println("p3 = " + p3); System.out.println("p1 to p2 distance = " + p1.distance(p2)); System.out.println("p2 to p1 distance = " + p2.distance(p1)); } }