angle Subroutine

subroutine angle(a, b, cos, sin)

Arguments

Type IntentOptional AttributesName
real :: a
real :: b
real :: cos
real :: sin

Contents

Source Code


Source Code

      subroutine angle(a,b,cos,sin)
      implicit double precision (a-h,o-z)
      z=sqrt(a**2+b**2)
      if (z==0.D0) then
        cos=1.D0
        sin=0.D0
      else
        cos=a/z
        sin=b/z
        a=z
        b=0.D0
      end if
      end subroutine angle