这个 JAVA朗,数学。atan2() 是java中的一种内置方法,用于计算纵坐标_val/横坐标_val之间的反正切 -圆周率 和 圆周率 .它返回直角坐标转换的角度 (横坐标,纵坐标) 到极坐标 (p,角度) .
null
- 当 横坐标 是负零 纵坐标 是阴性,还是 横坐标 是负的有限的 纵坐标 是负无穷大。
- 当两个参数都为正无穷大时,结果是最接近pi/4的双值。
- 当任一参数为NaN时,结果为NaN。
- 当 横坐标 正零和 纵坐标 是积极的还是消极的 横坐标 是正的有限的 纵坐标 是正无穷大。
- 当 横坐标 是负零 纵坐标 是积极的还是消极的 横坐标 是负的有限的 纵坐标 是正无穷大。
- 当 横坐标 正零和 纵坐标 是阴性,还是 横坐标 是正的有限的 纵坐标 是负无穷大。
- 当 横坐标 是积极的 纵坐标 是正零还是负零,或者 横坐标 正无穷大和 纵坐标 是有限的。
- 当 横坐标 是负面的 纵坐标 是正零还是负零,或者 横坐标 是负无穷大 纵坐标 是有限的。
- 当两个参数都为正无穷大时,结果是最接近pi/4的双值。
- 当 横坐标 正无穷大和 纵坐标 是负无穷大。
- 当 横坐标 是负无穷大 纵坐标 是正无穷大。
- 当两个参数都为负无穷大时,结果是最接近-3*pi/4的双值。
语法:
public static double atan2(double abscissa_val, double ordinate_val )
参数: 该方法接受两个参数:
- 纵坐标: 这是双类型,即纵坐标。
- 横坐标: 这是两种类型,即横坐标。
返回值: 该方法返回与该点(横坐标、纵坐标)相对应的极坐标中该点(p、角度)的θ分量。 下面的程序演示了java。朗,数学。atan2()方法: 项目1:
JAVA
// Java program to illustrate the // java.lang.StrictMath.atan2() import java.lang.*; public class Geeks{ public static void main(String[] args) { double abs_val = 0.3 , ord_val = 50.00 ; // It returns the theta component // in polar coordinates double atan2val = StrictMath.atan2(abs_val, ord_val); System.out.println("Arc tangent value is: " +atan2val); } } |
输出:
Arc tangent value is: 0.00599992800155516
项目2:
JAVA
// Java program to illustrate the // java.lang.StrictMath.atan2() import java.lang.*; public class Geeks{ public static void main(String[] args) { double abs_val = 0.3 , ord_val = - 50.00 ; // It returns the theta component // in polar coordinates double atan2val = StrictMath.atan2(abs_val, ord_val); System.out.println("Arc tangent value is: " +atan2val); } } |
输出:
Arc tangent value is: 3.135592725588238
方案3:
JAVA
// Java program to illustrate the // java.lang.StrictMath.atan2() import java.lang.*; public class Geeks{ public static void main(String[] args) { double abs_val = - 0.3 ,ord_val = 50.00 ; // It returns the theta component // in polar coordinates double atan2val = StrictMath.atan2(abs_val, ord_val); System.out.println("Arc tangent value is: " +atan2val); } } |
输出:
Arc tangent value is: -0.00599992800155516
方案4:
JAVA
// Java program to illustrate the // java.lang.StrictMath.atan2() import java.lang.*; public class Geeks{ public static void main(String[] args) { double abs_val = - 0.3 , ord_val = - 50.00 ; // It returns the theta component // in polar coordinates double atan2val = StrictMath.atan2(abs_val, ord_val); System.out.println("Arc tangent value is: " +atan2val); } } |
输出:
Arc tangent value is: -3.135592725588238
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END