Calculate longitude/latitude
Given the following input:
How can I calculate the longitude/latitude of the location "m"?
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)
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.
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.
链接地址: http://www.djcxy.com/p/84896.html上一篇: Java:计算大量位置和性能之间的距离
下一篇: 计算经度/纬度