1. melléklet: VBA for Excel koordináta-átszámító program

Public F As Double 'Nagy Fi
Public L As Double 'Nagy Lambda
Public fi As Double 'kis fi a gömbi átszámításkor
Public la As Double 'kis lambda a gömbi átszámításkor
Public fi1 As Double 'kis fi vessző
Public la1 As Double 'kis lambda vessző
Public X As Double 'EOV X
Public Y As Double 'EOV Y
Public a1 As Double 'segéd 1
Public a2 As Double 'segéd 2
Public a3 As Double 'segéd 3
'Számított konstansok:
Public pi As Double 'PI értéke (ATN(1)*4)
Public fio As Double '47,1˙ radiánba átszámolva
'Valódi konstansok
Public Const c = 1.0031100083
Public Const n = 1.0007197049
Public Const e = 0.0818205679
Public Const R = 6379743.001
Public Const m = 0.99993
Function fpm2tiz(fok As Double, perc As Double, masodperc As Double) As
Double
fpm2tiz = fok + perc / 60 + masodperc / 3600
End Function
Function Radian(gamma As Double) As Double
Radian = gamma * Atn(1) / 45
End Function
Function FL2XY(FiFok As Double, LambdaFok As Double, X1vagyY0 As Byte) As
Double
Set wf = Application.WorksheetFunction
pi = 4 * Atn(1)
fio = Radian(47.1)
F = Radian(FiFok)
L = Radian(LambdaFok - 19.04857178)
fi = 2 * (Atn(c * ((Tan(Atn(1) + F / 2)) ^ n) * ((1 - e * Sin(F)) /
(1 + e * Sin(F))) ^ (e * n / 2)) - Atn(1))
la = n * L
fi1 = wf.Asin(Cos(fio) * Sin(fi) - Sin(fio) * Cos(fi) * Cos(la))
la1 = wf.Asin(Cos(fi) * Sin(la) / Cos(fi1))
Select Case X1vagyY0
Case 0
FL2XY = 650000 + R * m * la1
Case 1
FL2XY = 200000 + R * m * Log(Tan(Atn(1) + fi1 / 2))
Case Else
FL2XY = -99999999999#
End Select
End Function



Vissza a Térképtudományi és Geoinformatikai Tanszék kezdőoldalára!