Calculate longitude/latitude
Asked Answered
A

3

8

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"?

Agrarian answered 22/12, 2008 at 14:3 Comment(0)
L
7

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)

Liveried answered 22/12, 2008 at 14:14 Comment(0)
N
4

Trilateration is what you want. This only requires 3 of your reference points, however the rest can be used to increase accuracy if you want to get really clever.

The trickiest part is working with long/lat as opposed to Cartesian coordinates, especially as the earth is not a perfect sphere.

Nihility answered 22/12, 2008 at 14:14 Comment(0)
O
3

This is a trilateration problem. In your case, you have multiple points of reference, so you can minimize the sum of squared-errors between the given distances and those corresponding to the optimal position of m.

Oberg answered 22/12, 2008 at 14:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.