NAME
d2r(3f) - [M_pixel:TRIGONOMETRY] convert degrees to radians
(LICENSE:PD)
SYNOPSIS
elemental real function d2r(degrees)
class(*),intent(in) :: radians
DESCRIPTION
Converts degrees to radians using the formula:
radians=real(degrees*acos(-1.0d0)/180.d0)
OPTIONS
degrees any standard scalar value supported by anyscalar_to_real(3f).
This includes REAL, INTEGER, DOUBLEPRECISION, ... .
EXAMPLE
Sample program
program demo_d2r
use M_pixel, only : d2r
implicit none
write(*,*)'With REAL array input ', &
& d2r([0.0,45.0,90.0,135.0,180.0])
write(*,*)'With INTEGER array input ', &
& d2r([0, 45, 90, 135, 180 ])
write(*,*)'With DOUBLEPRECISION ', &
& d2r(0.0d0),d2r(45.0d0),d2r(90.0d0),d2r(135.0d0),d2r(180.0d0)
end program demo_d2r
Results
With REAL array input 0.00000 0.785398185 1.57079637
2.35619450 3.14159274
With INTEGER array input 0.00000 0.785398185 1.57079637
2.35619450 3.14159274
With DOUBLEPRECISION 0.00000 0.785398185 1.57079637
2.35619450 3.14159274
AUTHOR
LICENSE
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
real,
|
intent(in) |
|
|
:: |
degrees |
|
Return Value
real