public class polar
{
//polar coordinates

protected double R,teta;

public polar()
{
R=0;
teta=0;
}

public polar(double Ri,double tetai)
{
R=Ri;
teta=tetai;
}

public polar(polar y)
{
R=y.ROku();
teta=y.tetaOku();
}

public void R_input(double Ri)
{
R=Ri;
}

public void teta_input(double tetai)
{
teta=tetai;
}


public void polar_input(double Ri,double tetai)
{
R=Ri;
teta=tetai;
}

public void kartesien_input(double xi,double xj)
{
R=Math.sqrt(xi*xi+xj*xj);
teta=Math.atan2(xj,xi);
}

public double ROku()
{
return R;
}

public double tetaOku()
{
return teta;
}

public double xi()
{
return R*Math.cos(teta);
}

public double xj()
{
return R*Math.sin(teta);
}

public void topla(polar y)
{
 kartesien_input((xi()+y.xi()),(xj()+y.xj()));
}


public void fark(polar y)
{
  kartesien_input((xi()-y.xi()),(xj()-y.xj()));
}

public polar polarOku()
{
return this;
}

public boolean esittir(polar v)
{
boolean b=((R==v.ROku())&&(teta==v.tetaOku()));
return b;
}

public boolean buyuktur(polar v)
{
  return (this.R>v.ROku());
}

public boolean kucuktur(polar v)
{
  return (this.R<v.ROku());
}

public String toString()
{
 return ""+R+"*exp("+teta+"i) ";
}

}
