Debian Codegraph @

doc/src/intrinsics/mathematical/asin.md

raw
1 # asin(x): Trigonometric Arcsine
2
3 Trigonometric arcsine function.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = asin(x)
11 elemental real(p) function asin(x)
12 elemental complex(p) function asin(x)
13 ```
14 ### Arguments
15
16 `x` the input value, can be real or complex; less than or equal to 1.
17
18 ### Return values
19
20 The returned value has the kind of the input value and TYPE may be real
21 or complex.
22
23 ## Description
24
25 **asin(x)** computes the arcsine of the argument **x**.
26
27 The arcsine is the inverse function of the sine function. It is commonly used in
28 trigonometry to find the angle when the lengths of the hypotenuse and the
29 opposite side of a right triangle are known.
30
31 ## Types
32
33 Supported argument types float, double, complex float, complex double.
34
35 ```fortran
36 interface asin
37 module procedure sasin, dasin, casin, zasin
38 end interface
39
40 contains
41
42 interface
43 elemental real(sp) function sasin(x)
44 real(sp), intent(in) :: x
45 end function
46
47 elemental real(dp) function dasin(x)
48 real(dp), intent(in) :: x
49 end function
50
51 elemental complex(sp) function casin(x)
52 complex(sp), intent(in) :: x
53 end function
54
55 elemental complex(dp) function zasin(x)
56 complex(dp), intent(in) :: x
57 end function
58 end interface
59 ```
60 ## Examples
61
62 ```fortran
63 program intrinsics_asin
64 implicit none
65 integer, parameter :: arg_x = kind(0.0)
66 real(arg_x) :: x1
67 real :: retval_x
68 real :: arg_x
69 retval_x = asin(0.84147098)
70 print *, ret_val_x
71 retval_x = asin(x1)
72 print *, ret_val_x
73 end program
74 ```
75
76 **Result**:
77
78 ```
79 0.99999
80 0.99999
81 ```
82 ## See Also
83
84 [acos](acos.md), [atan](atan.md).