toDegrees() 方法用于将参数转化为角度。
double toDegrees(double d)
d -- 任何原生数据类型。
该方法返回 double 值。
public class Test{
public static void main(String args[]){
double x = 45.0;
double y = 30.0;
System.out.println( Math.atan2(x, y) );
}
}
编译以上程序,输出结果为:
2578.3100780887044
1718.8733853924698
©2020 IT自习室京ICP备20010815号