Java toRadians() 方法

Java 教程 · 2019-02-08 16:14:04

toRadians() 方法用于将角度转换为弧度。

语法

double toRadians(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.toRadians(x) );
        System.out.println( Math.toRadians(y) );
    }
}

编译以上程序,输出结果为:

0.7853981633974483
0.5235987755982988

点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html

查看所有标签

The Hard Thing About Hard Things

The Hard Thing About Hard Things

Ben Horowitz / HarperBusiness / 2014-3-4 / USD 29.99

Ben Horowitz, cofounder of Andreessen Horowitz and one of Silicon Valley's most respected and experienced entrepreneurs, offers essential advice on building and running a startup—practical wisdom for ......一起来看看 《The Hard Thing About Hard Things》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具

SHA 加密
SHA 加密

SHA 加密工具