acos(x): Trigonometric Arc Cosine

Trigonometric arc cosine (inverse cosine) function.

Declaration

Sintaxe

retval = acos(x)
elemental real(p) function acos(x)
elemental complex(p) function acos(x)

Argumentos

x the input value, can be real or complex; less than or equal to 1.

Valores de retorno

The returned value has the kind of the input value and TYPE may be real or complex.

Descrição

acos(x) computes the arcsine of the argument x.

The arc cosine is the inverse function of the cosine function. It is commonly used in trigonometry to find the angle when the lengths of the hypotenuse and the base side of a right triangle are known.

Tipos

Supported argument types float, double, complex float, complex double.

interface acos
    module procedure sacos, dacos, cacos, zacos
end interface

contains

interface
    elemental real(sp) function sacos(x)
    real(sp), intent(in) :: x
    end function

    elemental real(dp) function dacos(x)
    real(dp), intent(in) :: x
    end function

    elemental complex(sp) function cacos(x)
    complex(sp), intent(in) :: x
    end function

    elemental complex(dp) function zacos(x)
    complex(dp), intent(in) :: x
    end function
end interface

Exemplos

program intrinsics_acos
implicit none
integer, parameter :: arg_x = kind(0.0)
real(arg_x) :: x1
real :: retval_x
real :: arg_x
retval_x = acos(0.84147098)
print *, ret_val_x
retval_x = acos(x1)
print *, ret_val_x
end program

Resultado:

0.570796336
0.570796336

Veja Também

asin, atan.