How to calculate the perimeter points of a circle in Lat Lon in C#

Spike UK
Spike UK used Ask the Experts™
I want a function that returns the Lat/Long of a point on a map - given the centre, distance (m) and azimuth (angle) in c#
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ste5anSenior Developer

Should it be a perfect circle? How accurate should it be?

Cause we're talking about a circle on a sphere.  For really small circles, you can use the normal 2 dimensional approach. For larger circles it's getting real hard..


We are talking small circles with the points returned  as an array of lat/ longs
Principal Software Engineer
As ste5an says, this is not a simple problem.  A proper, analytic solution requires spherical trigonometry.  However, an approximate solution can be obtained easily.

Build and store a table of how large a degree is in whatever system you are measuring in, English or metric at latitudes and longitudes, by tenths of a degree.  (One degree is not the same size at the equator as it is at the poles.)

Calculate the Cartesian coordinates of the desired points on the perimeter of the circle.  Interpolate latitude and longitude offsets from the Cartesian coordinates using the degree-size table at the closest coordinates to the center.  Add these offsets to the latitude and longitude coordinates of the center point to obtain the points on the perimeter.

This is a quick and dirty solution but should be good enough for circle radii of ten miles or less.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial