# Trilateration Calculation Issue

edit

I was able to do this following partially from this solution: Calculating intersection of two Circles?

I broke it up into 3 groups of intersections AB, AC and BC. Once I had those I took (with a reasonable error of course) the one that spat out 3 of the closest lat/lon pairs and that was good enough to get my the data I needed.

I've tried to implement Trilateration using 3 latitude and longitude points, and 3 distances

Using the following data:

``````LatA = 22.2825;
LonA = 114.162;
LatB = 19.0698;
LonB = 72.8788;
LatC = 45.3693;
LonC = -75.6805;

DistA = 0;
DistB = 2671 * 1.60934;
DistC = 7722 * 1.60934;
``````

What it spat out was:

``````-0.6578, 112.3055
``````

I don't believe the three circles intersect perfectly, but instead form a triangle of 3 different intersections of which I need the center. I'm not sure if this formula is the one I should be using or if anyone has another suggestion. I also went to http://www.freemaptools.com/radius-around-point.htm and made sure that the circles intersect (they do) and it should be spitting out something similar to LatA/LonA

I can paste my code if need be.

• Yes, paste code. – Martin F Jan 10 '15 at 19:44
• I did a very crude planar bilateration (with your sample data) and there was no actual intersection, but point A does appear at exactly the right distance from B and about 10% further away from C (than data distance). I haven't studied the other Q you cite but does it deal with "across-the-180-meridian problem"? (If not, first add 360 to LonC.) Do you convert to/from rads/degs? – Martin F Jan 10 '15 at 20:05
• BTW, are you seeking a general trilateration solution (always 3 distances)? Your test case, with one distance being zero, is not really involving 3 distances. – Martin F Jan 11 '15 at 21:26
• Right, but that was to check if the code worked. It not outputting something similar to the first one meant that it was incorrect. – Mathew Berg Jan 11 '15 at 23:51
• You say you tried to implement <linked question> but that has six answers. Which method did you use? – Martin F Jan 12 '15 at 1:33