IGMBaseLib 1.0

src/core/math/igmcore_math.f90

Go to the documentation of this file.
00001 
00012 module igmcore_math
00013   
00014   ! モジュール引用 ; Use statements
00015   !
00016   
00017   ! 種類型パラメタ
00018   ! Kind type parameter
00019   !
00020   use dc_types, only: DP   ! 倍精度実数型. Double precision. 
00021   
00022   ! 宣言文 ; Declaration statements
00023   !
00024   implicit none
00025   private
00026 
00027   ! 公開変数
00028   ! public variables
00029   !
00030 
00033   real(DP), parameter, public :: PI = 3.1415926535897932d0
00034   !real(DP), parameter, public :: PI = acos(-1.0d0)
00035  
00036   ! 公開手続き
00037   ! Public procedures
00038   !
00039   public :: toRadians, toDegrees
00040 
00041 contains
00042 
00043 ! 
00056 function toRadians(angdeg) result(rad)
00057 
00058   ! 宣言文 ; Declartion statement
00059   !
00060   real(DP), intent(in) :: angdeg
00061   real(DP) rad
00062 
00063   ! 実行文 ; Executable statement
00064   !
00065   rad = PI * angdeg / 180d0 
00066   
00067 end function toRadians
00068 
00069 ! 
00081 function toDegrees(angrad) result(deg)
00082 
00083   ! 宣言文 ; Declaration statement
00084   !
00085   real(DP), intent(in) :: angrad
00086   real(DP) deg
00087 
00088   ! 実行文 ; Executable statment
00089   !
00090   deg = 180d0 * angrad / PI
00091   
00092 end function toDegrees
00093  
00094 end module igmcore_math
 All Classes Namespaces Files Functions Variables