'Input >> Source Lat, Source Lon and Distance
'Output >> List with map of Lat and Lon
Sub GetPoints(lat As Double, lon As Double, d As Double) As List
Dim R As Double= 6378.1 'Radius of the Earth
Dim brng As Double
Dim returnlist As List
returnlist.Initialize
For angle = 0 To 360 Step 45
Dim latitude1, longitude1 As Double
Dim latitude2, longitude2 As Double
Dim lat2 As Double
Dim long2 As Double
latitude1 = lat * (cPI / 180.0)
longitude1 = lon * (cPI / 180.0)
brng = angle * (cPI / 180.0)
latitude2 = ASin(Sin(latitude1)*Cos(d/R) + Cos(latitude1)*Sin(d/R)*Cos(brng))
longitude2 = longitude1 + ATan2(Sin(brng)*Sin(d/R)*Cos(latitude1),Cos(d/R)-Sin(latitude1)*Sin(latitude2))
latitude2 = latitude2 * (180/cPI)
longitude2 = longitude2 * (180/cPI)
lat2 = Round2 (latitude2,6)
long2 = Round2 (longitude2,6)
returnlist.Add(CreateMap("lat":lat2,"lon":long2))
' Log(lat2 & "," & long2)
Next
Return returnlist
End Sub