C Library Functions - 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
| Nemo Release 3.1 | cosd (3) | June 29, 2025 |
Generated by manServer 1.08 from 2ea9999f-51c2-4ba5-8a07-36f41e5b3c12 using man macros.