# Trilateration using two or three points

We have a positioning system where we can measure our range without 0.1m from multiple beacons. The placement of the beacons is about on a 1-2km box. So we could get anywhere from 2-4 ranges from the beacons. The beacons are surveyed in place to an accuracy of about 1m.

We found the PHP code for the range case: Trilateration using 3 latitude and longitude points, and 3 distances and we're testing this in our "C" program w/ double precision math.

Questions: We're looking to get the most accurate position projection in LAT,LONG over a short area say max range up to 2km. What's the best aproach to get the least errors in the solution math? How big will the position errors be in meters?

Is there a code example of finding the two solutions in lat,long is we only have 2 ranges?

• The error is impossible to assess with only two ranges--in fact, you cannot pin the position down exactly because there will be two solutions and (if there's much accuracy at all) they will be widely separated. If you want to estimate the position errors, experiment with the cases where you have more than two ranges and apply a statistical solution like the one described at gis.stackexchange.com/a/40678/664. By doing the calculations in any reasonable projected coordinate system the typical precision in the estimates will be between 1e-7 and 1e-15 times the distances. – whuber Sep 12 '14 at 20:30