public class Position { // Represent a position (radius, angle) in polar coordinates. // All angles are in radians. // The internal representation of an angle is always at least 0 // and less than 2 * PI. Also, the radius is always at least 1. public Position ( ) { myRadius = 0; myAngle = 0; } public Position (Position p) { myRadius = p.myRadius; myAngle = p.myAngle; } public Position (double r, double theta) { myRadius = r; myAngle = theta; } public int xCoord (int xCenter, int unit) { return xCenter + (int) (myRadius * Math.cos (myAngle) * unit); } public int yCoord (int yCenter, int unit) { return yCenter - (int) (myRadius * Math.sin (myAngle) * unit); } public String toString ( ) { return "(" + myRadius + "," + myAngle + ")"; } // Update the current position either by changing myRadius // or by adding angularDistChange/myRadius to myAngle. // Preconditions: angularDistChange is less than 2 * PI and greater than -2 * PI; // one of rChange and angularDistChange is 0. public void update (double rChange, double angularDistChange) { // You fill this in. } // You will also need other methods. private double myRadius; private double myAngle; }