java tanh(ハイパーボリックタンジェント)値を取得する

java tanh(ハイパーボリックタンジェント)値を取得する

javaで、tanh(ハイパーボリックタンジェント)値を取得する手順を記述してます。「Math.tanh」にラジアン値を指定することで可能です。

環境

  • OS windows11 home
  • java 19.0.1

手順

tanh(ハイパーボリックタンジェント)値を取得するには、「Math.tanh」で可能です。

Math.tanh(ラジアン値)

実際に、使用してみます。

public class App {
    public static void main(String[] args) throws Exception {

        System.out.println(Math.tanh(Math.toRadians(45)));  // 0.6557942026326724
        System.out.println(Math.tanh(Math.toRadians(-45)));  // -0.6557942026326724

    }
}

取得されていることが確認できます。