ATAND(3) - [MATHEMATICS:TRIGONOMETRIC] Arc tangent AKA inverse tangent function in degrees
result = atand(x) | atand(y, x)
elemental real(kind=KIND) function atand(y,x)real(kind=KIND),intent(in) :: x real(kind=**),intent(in),optional :: y
o If Y is present X and Y must both be of the same kind. o KIND can be any kind supported by the associated type. o The returned value is real of the same kind as X.
ATAND(3) calculates the Arc Tangent function in degrees.
o X : The real value to compute the arctangent of. o Y : is real of the same kind as X. If X is zero, Y must not be zero.
The returned value is a real type of the same kind as X that approximates the arc tangent of X expressed in degrees. If Y is present, the result is identical to ATAN2D(Y,X). The result lies in the range -90 <= ATAND(X) <= 90 .
atand(1.0) has the value 45.0 (approximately).
Sample program:
program demo_atand 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, atand(x)Results:print all, atand( 2.0d0, 2.0d0),atand( 2.0d0, 2.0d0)/Deg_Per_Rad print all, atand( 2.0d0,-2.0d0),atand( 2.0d0,-2.0d0)/Deg_Per_Rad print all, atand(-2.0d0, 2.0d0),atand(-2.0d0, 2.0d0)/Deg_Per_Rad print all, atand(-2.0d0,-2.0d0),atand(-2.0d0,-2.0d0)/Deg_Per_Rad
end program demo_atand
> 70.765182904405478 > 45.000000000000000 0.78539816339744828 > 135.00000000000000 2.3561944901923448 > -45.000000000000000 -0.78539816339744828 > -135.00000000000000 -2.3561944901923448
Fortran 2023
ATAN2D(3), TAND(3), ATAN2(3), TAN(3), ATAN2PI(3), TANPI(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
o wikipedia: inverse trigonometric functions
Nemo Release 3.1 | atand (3fortran) | November 02, 2024 |