Java toDegrees() 方法
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.toDegrees(x) );
System.out.println( Math.toDegrees(y) );
}
}
編譯以上程式,輸出結果為:
2578.3100780887044 1718.8733853924698

Java Number類