Manual Reference Pages  - cosd (3fortran)

NAME

COSD(3) - [MATHEMATICS:TRIGONOMETRIC] Degree cosine function

SYNOPSIS

result = cosd(x)

         elemental real(kind=KIND) function cosd(x)

real(kind=KIND),intent(in) :: x

CHARACTERISTICS

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.

DESCRIPTION

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.

OPTIONS

o X : The angle in degrees to compute the cosine of.

RESULT

The return value is an approximation of the cosine of X.

The return value lies in the range

      -1 lt;= cosd(x) lt;= 1

EXAMPLES

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_cosd

Results:

     > 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

STANDARD

Fortran 2023

SEE ALSO

ACOSD(3), ACOS(3), SIND(3), TAND(3)

RESOURCES

o Wikipedia:sine and cosine
Fortran intrinsic descriptions


Nemo Release 3.1 cosd (3fortran) February 19, 2025
Generated by manServer 1.08 from c90ff93f-ca7f-486e-b1a4-58ebda9def09 using man macros.