Java atan()方法具有哪些功能呢?
Java atan()方法的功能简介
atan()
方法返回指定double
值的反正切值
atan()方法的语法
double atan(double d)
参数说明
d
-double
数据类型
返回值
- 此方法返回指定
double
值的反正切值
例
public class testClass{
public static void main(String args[]) {
double d= 45.0;
double r= Math.toRadians(d);
System.out.format("The arctangent of %.4f is %.4f degrees %n", Math.cos(r),
Math.toDegrees(Math.atan(Math.sin(r))));
}
}
/*运行以上代码,可返回下列信息
The arctangent of 0.7071 is 35.2644 degrees
*/
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。