Function ProjecStéréo(ByVal Lat As Double, ByVal Lon As Double) As Variant
Dim XProj As Double, YProj As Double
CalcProjecStéréo XProj, YProj, Lat, Lon
ProjecStéréo = Array(XProj, YProj)
End Function
Sub CalcProjecStéréo(XProj As Double, YProj As Double, ByVal Lat As Double, ByVal Lon As Double)
Const LonRéf = 1.625, CosLatRéf = 544030691 / 795840868, SinLatRéf = (1 - CosLatRéf ^ 2) ^ 0.5
Dim X As Double, Y As Double, Z As Double, Zr As Double, Éch As Double
Lat = Rad(Lat): Lon = Rad(Lon - LonRéf)
Y = Sin(Lat): Z = Cos(Lat): X = Sin(Lon) * Z: Z = Cos(Lon) * Z
Zr = Z * CosLatRéf + Y * SinLatRéf: Y = Y * CosLatRéf - Z * SinLatRéf
Éch = 2 / (Zr + 1) * 6368: XProj = X * Éch: YProj = Y * Éch
End Sub
Private Function Rad(ByVal Deg As Double) As Double
Const K = 14964008 / 857374503: Rad = Deg * K
End Function