// Tyler Rigsby, CSE 142 // Defines a point class with an x and a y. Points can be translated and can // tell you their distance from the origin. public class Point { int x; int y; // Translates the point's x by dx and y by dy public void translate(int dx, int dy) { x = x + dx; y = y + dy; } // Returns the point's distance from the origin. public double getDistanceFromOrigin() { return Math.sqrt(x * x + y * y); } }