[UP]


Manual Reference Pages  - cosd (3)

NAME

cosd(3f) - [M_units:TRIGONOMETRY] calculate cosine of value in degrees (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

elemental real function cosd(degrees)

    class(*),intent(in) :: degrees

DESCRIPTION

Calculate cosine of input value in degrees

OPTIONS

degrees
  any standard scalar value supported by anyscalar_to_double(3f).

EXAMPLE

Sample program

   program demo_cosd
   use M_units, only :  cosd
   implicit none
      write(*,*)’With REAL array input    ’, &
      & cosd([ 0.0, 15.0, 30.0, 45.0, 60.0, 75.0, 90.0, 180.0, 270.0 ])
      write(*,*)’With INTEGER array input ’,  &
      & cosd([0,15,30,45,60,75,90,180,270])
      write(*,*)’With DOUBLEPRECISION     ’,        &
      & cosd(0.0d0),cosd(15.0d0),cosd(90.0/3.0d0),  &
      & cosd(90.0/2.0d0),cosd(60.0d0),cosd(75.0d0), &
      & cosd(90.0d0),cosd(180.0d0),cosd(270.0d0)
   end program demo_cosd

Results

    With REAL array input      1.00000000       0.965925813   0.866025448
                               0.707106769      0.499999970   0.258819073
                              -4.37113883E-08  -1.00000000    1.19248806E-08
    With INTEGER array input   1.00000000       0.965925813   0.866025448
                               0.707106769      0.499999970   0.258819073
                              -4.37113883E-08  -1.00000000    1.19248806E-08
    With DOUBLEPRECISION       1.00000000       0.965925813   0.866025448
                               0.707106769      0.499999970   0.258819073
                              -4.37113883E-08  -1.00000000    1.19248806E-08

AUTHOR

John S. Urban

LICENSE

Public Domain


cosd (3) March 11, 2021
Generated by manServer 1.08 from 65e569be-6d06-4b1e-b226-20dd7c8de54c using man macros.