MODULE MyTrigFunctions
   IMPLICIT NONE
   REAL, PARAMETER  :: Pi        = 3.1415926
   REAL, PARAMETER  :: Degree180 = 180.0
   REAL, PARAMETER  :: R_to_D    = Degree180/Pi
   REAL, PARAMETER  :: D_to_R    = Pi/Degree180

   PRIVATE          :: Degree180, R_to_D, D_to_R
   PRIVATE          :: RadianToDegree, DegreeToRadian
   PUBLIC           :: MySin, MyCos

CONTAINS

   REAL FUNCTION RadianToDegree( Radian )
      IMPLICIT NONE
      REAL, INTENT(IN) :: Radian
      RadianToDegree = Radian * R_to_D
   END FUNCTION RadianToDegree

   REAL FUNCTION DegreeToRadian( Degree )
      IMPLICIT NONE
      REAL, INTENT(IN) :: Degree
      DegreeToRadian = Degree * D_to_R
   END FUNCTION DegreeToRadian

   REAL FUNCTION MySin( x )
      IMPLICIT NONE
      REAL, INTENT(IN) :: x
      MySin = SIN( DegreeToRadian(x) )
   END FUNCTION MySin

   REAL FUNCTION MyCos( x )
      IMPLICIT NONE
      REAL, INTENT(IN) :: x
      MyCos = COS( DegreeToRadian(x) )
   END FUNCTION MyCos

END MODULE MyTrigFunctions
