C Library Functions  - d2r (3)

NAME

d2r(3f) - [M_pixel: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_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

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 d2r (3) July 22, 2023
Generated by manServer 1.08 from d0454e68-0586-461d-9d60-609f80b77a85 using man macros.