Debian Codegraph @

doc/src/intrinsics/mathematical/atan.md

raw
1 # atan(x): Trigonometric ArcTangent
2
3 Trigonometric arctangent (inverse arctangent) function.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = atan(x)
11 elemental real(p) function atan(x)
12 elemental complex(p) function atan(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 **atan(x)** computes the arctangent of the argument **x**.
26
27 The arc tangent is the inverse function of the arctangent function. It is commonly used in
28 trigonometry to find the angle when the lengths of the opposite side of a right triangle
29 and base are known, i.e., perpendicular and base length.
30
31 ## Types
32
33 Supported argument types float, double, complex float, complex double.
34
35 ```fortran
36 interface atan
37 module procedure satan, datan, catan, zatan
38 end interface
39
40 contains
41
42 interface
43 elemental real(sp) function satan(x)
44 real(sp), intent(in) :: x
45 end function
46
47 elemental real(dp) function datan(x)
48 real(dp), intent(in) :: x
49 end function
50
51 elemental complex(sp) function catan(x)
52 complex(sp), intent(in) :: x
53 end function
54
55 elemental complex(dp) function zatan(x)
56 complex(dp), intent(in) :: x
57 end function
58 end interface
59 ```
60 ## Examples
61
62 ```fortran
63 program intrinsics_atan
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 = atan(0.84147098)
70 print *, ret_val_x
71 retval_x = atan(x1)
72 print *, ret_val_x
73 end program
74 ```
75
76 **Result**:
77
78 ```
79 0.699521642
80 0.699521642
81 ```
82 ## See Also
83
84 [asin](asin.md), [acos](acos.md).