在 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

更新日期: 26-Jun-2020

184 次浏览

开启您的职业生涯

完成课程认证

立即开始
广告
© . All rights reserved.