スポンサードリンク | |
角度(度分秒)を10進数に変換したい |
10進数の角度を60進数の角度(度分秒)に変換したい |
Function Convert_Decimal(Degree_Deg As String) As Double Dim degrees As Double Dim minutes As Double Dim seconds As Double ' degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1)) ' minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _ InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, "°") - 2)) / 60 ' seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + 2, _ Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 2)) / 3600 ' Convert_Decimal = degrees + minutes + seconds End Function |
Function Convert_Decimal2(Degree_Deg As String) As Double Dim degrees As Double Dim minutes As Double Dim seconds As Double ' degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1)) ' minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 1, _ InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, "°") - 1)) / 60 ' seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + 1, _ Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 1)) / 3600 ' Convert_Decimal = degrees + minutes + seconds End Function |
スポンサードリンク
PageViewCounter
Since2006/2/27