I have the center of a circle and it's radius and I need to place variable amount of markers on the outline/stroke of the circle. The distance between this markers should kept same, so if I have 8 markers to put on the orbit, each of them has 45 degree space (360 / 8) and also it should not be hard-coded as the number of markers is variable.
I wanted to know what is the right way for calculating the Geo-coordinates of each marker?
here you can see an example, the outer marker should move on, however I can't calculate the proper LatLng values.
I finally came up with this formula:
var dg = 90;
var lat = Math.sin(dg * Math.PI / 180) * r + center_geo_lat;
var lng = Math.cos(dg * Math.PI / 180) * r + center_geo_lng;
If you look at snapshots you can see that markers at 0 and 180 degree has placed quite fine, but it seems there is something wrong with other markers. It's gonna works fine for me, because I don't need such a perfect accuracy, however I'm wondering what's cause the problem?