十進経緯度・度分秒の相互変換

Private Function DD2DMS(ByRef DecimalDegree As Double, ByRef Degree As Long, ByRef Minute As Long, ByRef Second As Double, Optional Reverce As Boolean = False)
    '十進経緯から度分秒に変換
    If Reverce = False Then
        Dim pLatLonFormat As ILatLonFormat
        Set pLatLonFormat = New LatLonFormat
        pLatLonFormat.GetDMS DecimalDegree, Degree, Minute, Second
    
    '度分秒から十進経緯度に変換
    Else
        DecimalDegree = Degree + Minute / 60 + Second / 3600
    
    End If

End Function

Sub GetDMS()
    Dim aa As ILatLonFormat
    Set aa = New LatLonFormat
    
    Dim dms As Double
    dms = 45.0000000001
    
    Dim dd As Long
    Dim mm As Long
    Dim ss As Double
    
    Call aa.GetDMS(dms, dd, mm, ss)
    
    Debug.Print dd, mm, ss

End Sub