I\'ve come up with a method that takes a coordinate and a range (in miles) and return a list of coordinates that form a circle around the origin. I seem to have made some p
have a look at this (includes example code): http://www.movable-type.co.uk/scripts/latlong.html
the "Spherical Law of Cosines" gives you the distance between two coordinates. it should be possible to modify this to give you the coordinates around a specified center and a specified radius (distance).
Do your calculations in a spherical coordinate space and then convert them to latitude/longitude.
Rather than defining LONG_MILE
as a constant, you should calculate it inside your
GetRadius
function: LONG_MILE = LAT_MILE / cos(OriginLatitude*PI/180.0)
Also, it looks a little weird that you're taking sin()
and cos()
of your integer
index i
. If your intention is to generate points at 1 radian intervals surrounding
the center point, it'll work. But I suspect you might want something more like
angle_radians = i * 2.0*PI/Points;
and substitute sin(angle_radians)
for sin(i)
, etc.