Google-maps – Calculate longitude/latitude

geocodinggeolocationgoogle mapsmapsyahoo-maps

Given the following input:

  • known longitudes/latitudes of 1..n locations
  • known distance between locations 1..n and another location "m"

How can I calculate the longitude/latitude of the location "m"?

Best Answer

This sounds like a basic latitude-longitude triangulation question. The common approaches are outlined in a Yahoo! Answers topic here. There are likely libraries to do this in many languages. A google search for "latitude longitude triangulation" plus your language of choice will likely reveal some existing code to use. "Geocoding" is another common task rolled into similar libraries, so that may be another useful keyword.

Edit: As others have mentioned, "trilateration" seems to be the best term. However, depending on your data and requirements, there are simpler approximation solutions that may satisfy your requirements.

The Yahoo! Answers post is quoted below for convenience:

"For larger distances, spherical geometry. For relatively small ones, treat the earth as flat, and the coordinates as xy coordinates. For the distances to work with the degrees of the coordinates, you will have to use the cosine function to convert from one to the other. (While degrees of latitude are about 69 miles all over the earth, degrees of longitude vary from the same at the equator to 0 at the poles.)

You have the center points of three circles and the radius of those circles. They are supposed to intersect at one point, so you can treat them in pairs to find the intersection points of each and throw out the ones that don't match http://mathworld.wolfram.com/Circle-CircleIntersection.html." (mike1942f)