// This class represents a Point on the cartesian plane public class Point { int x; int y; // Translates this point by the given changeX and changeY public void translate(int changeX, int changeY) { x = x + changeX; y = y + changeY; } // returns the distance from this point to the origin (0, 0) public double distanceFromOrigin() { return Math.sqrt(x * x + y * y); } }