Java sin() 方法

Java 教程 · 2019-02-08 14:12:10

sin() 方法用于返回指定double类型参数的正弦值。

语法

double sin(double d)

参数

  • d -- 任何原生数据类型。

返回值

返回指定double类型参数的正弦值。

实例

public class Test{
    public static void main(String args[]){
    
        double degrees = 45.0;
        double radians = Math.toRadians(degrees);

        System.out.format("pi 的值为 %.4f%n", Math.PI);
        System.out.format("%.1f 度的正弦值为 %.4f%n", degrees, Math.sin(radians));

    }
}

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

pi 的值为 3.1416
45.0 度的正弦值为 0.7071

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

查看所有标签

Python Machine Learning

Python Machine Learning

Sebastian Raschka / Packt Publishing - ebooks Account / 2015-9 / USD 44.99

About This Book Leverage Python' s most powerful open-source libraries for deep learning, data wrangling, and data visualization Learn effective strategies and best practices to improve and opti......一起来看看 《Python Machine Learning》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具