Manual Reference Pages  - atan (3fortran)

NAME

ATAN(3) - [MATHEMATICS:TRIGONOMETRIC] Arctangent AKA inverse tangent function

SYNOPSIS

result = atan([x) | atan(y, x)

         elemental TYPE(kind=KIND) function atan(y,x)

TYPE(kind=KIND),intent(in) :: x TYPE(kind=**),intent(in),optional :: y

CHARACTERISTICS

o If Y is present X and Y must both be real. Otherwise, X may be complex.
o KIND can be any kind supported by the associated type.
o The returned value is of the same type and kind as X.

DESCRIPTION

ATAN(3) computes the arctangent of X.

OPTIONS

o X : The value to compute the arctangent of. if Y is present, X shall be real.
o Y : is of the same type and kind as X. If X is zero, Y must not be zero.

RESULT

The returned value is of the same type and kind as X. If Y is present, the result is identical to ATAN2(Y,X). Otherwise, it is the arc tangent of X, where the real part of the result is in radians and lies in the range -PI/2 <= ATAN(X) <= PI/2

EXAMPLES

Sample program:

    program demo_atan
    use, intrinsic :: iso_fortran_env, only : real32, real64, real128
    implicit none
    character(len=*),parameter :: all=’(*(g0,1x))’
    real(kind=real64),parameter :: &
     Deg_Per_Rad = 57.2957795130823208767981548_real64
    real(kind=real64) :: x
        x=2.866_real64
        print all, atan(x)

print all, atan( 2.0d0, 2.0d0),atan( 2.0d0, 2.0d0)*Deg_Per_Rad print all, atan( 2.0d0,-2.0d0),atan( 2.0d0,-2.0d0)*Deg_Per_Rad print all, atan(-2.0d0, 2.0d0),atan(-2.0d0, 2.0d0)*Deg_Per_Rad print all, atan(-2.0d0,-2.0d0),atan(-2.0d0,-2.0d0)*Deg_Per_Rad

end program demo_atan

Results:

     > 1.235085437457879
     > .7853981633974483 45.00000000000000
     > 2.356194490192345 135.0000000000000
     > -.7853981633974483 -45.00000000000000
     > -2.356194490192345 -135.0000000000000

STANDARD

FORTRAN 77 for a complex argument; and for two arguments Fortran 2008

SEE ALSO

ATAN2(3), TAN(3)

RESOURCES

o wikipedia: inverse trigonometric functions
Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 atan (3fortran) November 02, 2024
Generated by manServer 1.08 from 9c96d4b0-b89a-4c26-9bda-87b16c6639a6 using man macros.