C Library Functions - d2r (3)
NAME
d2r(3f) - [M_units:TRIGONOMETRY] convert degrees to radians
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Example
Author
License
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_units, 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
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | d2r (3) | June 29, 2025 |
Generated by manServer 1.08 from f6511dcb-6972-475d-92e2-a4130cd55cad using man macros.