Java 教程 Java toDegrees() 方法

cleveland · 2022-05-24 23:07:35 · 热度: 11

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 & Math 类 相关内容

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册