public class robot
{ 
  public String name;
  public double R;
  public double theta;
  
  public robot(String is) {R=0;theta=0;name=is;}
  public robot(String is,double Ri) {name=is;R=Ri;theta=0;}
  public robot(String is,double Ri,double theta_angle) {name=is;R=Ri;theta=theta_angle*Math.PI/180.0;}
  public robot(robot r1) {name=r1.name;R=r1.R;theta=r1.theta;}
    
  public void  turn_north() {theta=Math.PI/2.0;}
  public void  turn_south() {theta=3.0*Math.PI/2.0;}
  public void  turn_west() {theta=Math.PI;}
  public void  turn_east() {theta=Math.PI;}
  public void  turn(double angle) {theta+=angle*Math.PI/180.0;}
  public void  forward()  {R+=1;}
  public void  forward(double Ri)  {R+=Ri;}
  public void  backward()  {R-=1;}
  public void  backward(double Ri)  {R-=Ri;}
     
  public String toString()
  { String s="------------"+name+"--------------------\n";    
    s+="cartesian coordinates x = "+R*Math.sin(theta)+" y = "+R*Math.cos(theta)+" \n";
    s+="polar coordinates R = "+R+" theta = "+theta*180/Math.PI+" \n";return s; }     
}