[UP]


Manual Reference Pages  - norm_angle_360 (3)

NAME

norm_angle_360(3f) - [M_units:TRIGONOMETRY] Return input angle given in degrees as angle between 0 and 360 (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Results
Example
License

SYNOPSIS

elemental function norm_angle_360(ang) result(rev)

    doubleprecision, intent(in) :: ang
    doubleprecision             :: rev
       or
    real, intent(in) :: ang
    real             :: rev
       or
    integer, intent(in) :: ang
    integer             :: rev

DESCRIPTION

Given an input angle in degrees, normalize the value to fall in the
range 0 to 360
  degrees.

OPTIONS

ang Input angle (degrees)

RESULTS

rev Return input angle (degrees) normalized to range 0 to 360 degrees

EXAMPLE

Sample program:

   program demo_norm_angle_360
   use M_units, only : norm_angle_360
   implicit none
   real,parameter :: PI=360
   real           :: val
   integer        :: i
   do i=-2,2
      val=i*2*pi;   write(*,*)val,norm_angle_360(val)
      val=i*pi;     write(*,*)val,norm_angle_360(val)
      val=i*pi/2;   write(*,*)val,norm_angle_360(val)
      write(*,*)
   enddo
   end program demo_norm_angle_360

Results:

     -1440.00000       0.00000000
     -720.000000       0.00000000
     -360.000000       0.00000000

-720.000000 0.00000000 -360.000000 0.00000000 -180.000000 180.000000

0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000

720.000000 0.00000000 360.000000 0.00000000 180.000000 180.000000

1440.00000 0.00000000 720.000000 0.00000000 360.000000 0.00000000

LICENSE

MIT License


norm_angle_360 (3) October 17, 2020
Generated by manServer 1.08 from 6e82c8e3-a17e-4f1d-9da9-4ec21250839b using man macros.