You are on page 1of 2

Function Convert_Degree(Decimal_Deg) As Variant

With Application
Degrees = Int(Decimal_Deg)
Minutes = (Decimal_Deg - Degrees) * 60
Seconds = Format(((Minutes - Int(Minutes)) * 60), "0")
Convert_Degree = " " & Degrees & " " & Int(Minutes) & "' " _
& Seconds + Chr(34)
End With
End Function

Private Sub btnKira_Click()


phi = 3.14159265358979
Dim bg1, j1 As Double
bg1 = Val(txtBearing.Text)
Dim txt, dot, txtdd, txtmmss, dd, mm, ss, t As
Double
txt = txtBearing.Text
dot = InStr(txt, ".")
txtdd = Mid(txt, 1, dot - 1)
txtmmss = Mid(txt, dot + 1)
' convert
dd = CInt(txtdd)
mm = CInt(Left(txtmmss, 2))
ss = CInt(Right(txtmmss, 2))
t = dd + (mm / 60) + (ss / 3600)

j1 = Val(txtJarak.Text)

'Label8.Caption = g1
Label11.Caption = Convert_Degree(t) 'bg1
Label12.Caption = j1

lat1 = j1 * Cos(t * phi / 180)


dip1 = j1 * Sin(t * phi / 180)
Label15.Caption = Math.Round(lat1, 3)
Label16.Caption = Math.Round(dip1, 3)

'NewCoor
Label10.Caption = txtX1 + Label15.Caption
Label17.Caption = txtX1 + Label15.Caption
End Sub

You might also like