cosd(3f) - [M_units:TRIGONOMETRY] calculate cosine of value in degrees (LICENSE:PD)
Synopsis
Description
Options
Example
Author
License
elemental real function cosd(degrees)
class(*),intent(in) :: degrees
Calculate cosine of input value in degrees
degrees any standard scalar value supported by anyscalar_to_double(3f).
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_cosdResults
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
John S. Urban
Public Domain
Nemo Release 3.1 | cosd (3) | February 23, 2025 |