I need to get the boundingbox around a latitude and longitude with a distance of xx KM.
This point o................^
. |
. 100km
. |
<---100km--- lat/lng ---100km--->
| .
100km .
| .
V...............o This point
So I thought I do a function like this
Function latlngToBox(lat As Double, lng As Double, km As Double) As boundingBox
' angle per km = 360 / (2 * pi * 6378) = 0.0089833458 (Found this fomula on the web
Dim angle As Double = km * 0.0089833458
Dim box As boundingBox = New boundingBox
box.minLat = lat - angle
box.minLng = lng - angle
box.maxLat = lat + angle
box.maxLng = lng + angle
Return box
End Function
However when I put the points on a map I get this which is more like a rectangle. So I think the formula is wrong.