ACOSD(3) - [MATHEMATICS:TRIGONOMETRIC] Arccosine (inverse cosine) function in degrees
result = acosd(x)
elemental real(kind=KIND) function acosd(x)real(kind=KIND),intent(in) :: x
o KIND may be any kind supported by the real type. o The returned value will be of the same type and kind as the argument.
ACOSD(3) computes the arccosine of X in degrees (inverse of COSD(X)). For example, ACOSD(-1.0) has the value 180.0 (approximately).
o X : The value to compute the arctangent of. If the type is real, the value must satisfy |X| <= 1.
The return value is of the same type and kind as X. The result has a value equal to a processor-dependent approximation to the arc cosine of X. It is expressed in degrees and lies in the range
0 <= ACOSD (X) <= 180
Sample program:
program demo_acosd use, intrinsic :: iso_fortran_env, only : real32,real64,real128 implicit none character(len=*),parameter :: all=(*(g0,1x)) real(kind=real64) :: x , d2rResults:! basics print *,acosd(-1.0) -->,acosd( -1.0 ) print *,acosd( 0.0) -->,acosd( -1.0 ) print *,acosd( 1.0) -->,acosd( 0.0 ) x = 0.866_real64 print all,acosd(,x,) is , acosd(x) ! any real kind write(*,*) acosd(-1.0_real64) ! elemental print all,elemental,acosd([-1.0,-0.5,0.0,0.50,1.0]) ! end program demo_acosd
> acosd(-1.0) --> 180.000000 > acosd( 0.0) --> 180.000000 > acosd( 1.0) --> 90.0000000 > acosd( 0.86599999999999999 ) is 30.002910931188026 > 180.00000000000000 > elemental 180.000000 120.000000 90.0000000 60.0000000 0.00000000
FORTRAN 2023
Inverse function: COSD(3)
Fortran intrinsic descriptions (license: MIT) @urbanjost
o wikipedia: inverse trigonometric functions
Nemo Release 3.1 | acosd (3fortran) | November 02, 2024 |