COSD(3) - [MATHEMATICS:TRIGONOMETRIC] Degree cosine function
result = cosd(x)
elemental real(kind=KIND) function cosd(x)real(kind=KIND),intent(in) :: x
o X is of type real of any valid kind. o KIND may be any real kind. o The returned value will be of the same type and kind as the argument X.
COSD(3) computes the cosine of an angle X given the size of the angle in degrees.
The cosine is the ratio of the adjacent side to the hypotenuse of a right-angled triangle.
o X : The angle in degrees to compute the cosine of.
The return value is an approximation of the cosine of X.
The return value is in degrees and lies in the range -1 <= COSD(X) <= 1 [char46]
cosd(180.0) has the value -1.0 (approximately).
Sample program:
program demo_cosd implicit none character(len=*),parameter :: g2=(a,t20,g0) write(*,g2)cosd(0.0)=,cosd(0.0) write(*,g2)cosd(180.0)=,cosd(180.0) write(*,g2)cosd(90.0d0)=,cosd(90.0d0) write(*,g2)cosd(360.0)=,cosd(360.0) write(*,g2)cosd(-360.0)=,cosd(-360.0) write(*,g2)cosd(-2000*180.0)=,cosd(-2000*180.0) write(*,g2)cosd(3000*180.0)=,cosd(3000*180.0) end program demo_cosdResults:
> cosd(0.0)= 1.00000000 > cosd(180.0)= -1.00000000 > cosd(90.0d0)= 0.0000000000000000 > cosd(360.0)= 1.00000000 > cosd(-360.0)= 1.00000000 > cosd(-2000*180.0)= 1.00000000 > cosd(3000*180.0)= 1.00000000
Fortran 2023
ACOSD(3), ACOS(3), SIND(3), TAND(3)
Fortran intrinsic descriptions
o Wikipedia:sine and cosine
Nemo Release 3.1 | cosd (3fortran) | November 02, 2024 |