Groovy-asin

提供:Dev Guides
移動先:案内検索

グルーヴィー-asin()

このメソッドは、指定されたdouble値のアークサインを返します。

構文

double asin(double d)

パラメーター

d-このメソッドは、doubleデータ型の値を受け入れます。

戻り値

このメソッドは、指定されたdouble値のアークサインを返します。

以下は、このメソッドの使用例です-

class Example {
   static void main(String[] args) {
      double degrees = 45.0;
      double radians = Math.toRadians(degrees);

      System.out.format("The value of pi is %.4f%n", Math.PI);
      System.out.format("The arcsine of %.4f is %.4f degrees %n",
      Math.sin(radians), Math.toDegrees(Math.asin(Math.sin(radians))));
   }
}

上記のプログラムを実行すると、次の結果が得られます-

The value of pi is 3.1416
The arcsine of 0.7071 is 45.0000 degrees