1Imports NETGeographicLib
2
3Module example_CassiniSoldner
4    Sub Main()
5        Try
6            Dim geod As Geodesic = New Geodesic() ' WGS84
7            Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris
8            Dim proj As CassiniSoldner = New CassiniSoldner(lat0, lon0, geod)
9            ' Sample forward calculation
10            Dim lat As Double = 50.9, lon = 1.8 ' Calais
11            Dim x, y As Double
12            proj.Forward(lat, lon, x, y)
13            Console.WriteLine(String.Format("X: {0} Y: {1}", x, y))
14            ' Sample reverse calculation
15            x = -38000.0 : y = 230000.0
16            proj.Reverse(x, y, lat, lon)
17            Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon))
18        Catch ex As GeographicErr
19            Console.WriteLine(String.Format("Caught exception: {0}", ex.Message))
20        End Try
21    End Sub
22End Module
23