在 Java 中获取某个值的双曲正弦
为了在 Java 中获取某个值的双曲正弦,我们使用 java.lang.Math.sinh() 方法。sinh() 方法接受弧度形式的参数,并返回该参数的双曲正弦,该参数充当角度。
声明 − java.lang.Math.sinh() 声明如下 −
public static double sinh(double x)
其中,x 以弧度表示的角度。
让我们来看一个在 Java 中获取某个值的双曲正弦的程序。
示例
import java.lang.Math;
public class Example {
public static void main(String[] args) {
// get two double numbers in degrees
double x = 90;
double y = 180;
// convert them in radians
x = Math.toRadians(x);
y = Math.toRadians(y);
// computing and displaying the hyperbolic sine of these doubles
System.out.println("Hyperbolic sine of " + x + " = " + Math.sinh(x));
System.out.println("Hyperbolic sine of " + y + " = " + Math.sinh(y));
}
}输出
Hyperbolic sine of 1.5707963267948966 = 2.3012989023072947 Hyperbolic sine of 3.141592653589793 = 11.548739357257748
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 语言编程
C++
C#
MongoDB
MySQL
Javascript
PHP