public class Point {
private double x;
private double y;
public Point(double x,double y){
this.x=x;
this.y=y;
}
public double radius(){
return Math.sqrt(x*x+y*y);
}
public double angle(){
return(180/3.14159)*Math.atan2(y, x);
}
public static void main(String[] args){
Point p1=new Point(10,10);
System.out.print("x="+p1.x+" ");
System.out.print("y="+p1.y+" ");
int i=(int)p1.angle();
int j=(int)p1.radius();
System.out.print("radius="+i+" ");
System.out.print("angle="+j+" ");
System.out.println();
Point p2=new Point(15,18);
i=(int)p2.angle();
j=(int)p2.radius();
System.out.print("x="+p2.x+" ");
System.out.print("y="+p2.y+" ");
System.out.print("radius="+i+" ");
System.out.print("angle="+j+" ");
}
}