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
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.