d2r(3f) - [M_pixel:TRIGONOMETRY] convert degrees to radians (LICENSE:PD)
Synopsis
Description
Options
Example
Author
License
elemental real function d2r(degrees)
class(*),intent(in) :: radians
Converts degrees to radians using the formula:
radians=real(degrees*acos(-1.0d0)/180.d0)
degrees any standard scalar value supported by anyscalar_to_real(3f). This includes REAL, INTEGER, DOUBLEPRECISION, ... .
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_d2rResults
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
John S. Urban
Public Domain
Nemo Release 3.1 | d2r (3m_pixel) | April 21, 2023 |