0

As I know that Trilateration is the process of finding the center of the area of intersection of three spheres. I wrote Trilateration method in c++, I took the equations and it is details from Trilaterationenter in Wikipedia and 2d trilateration

When take an example like the following:

Example_1: p1(5,10), p2(15,10), p3(10,20), and r1 = 9, r2 = 7, r3 = 8, the answer is (11.6, 13.8) which is logical answer.

enter image description here

but when case like the following example, the answer is like a garbage number, I made sure from the calculations but in such case I don't know the reason!

Example_2: p1(53.279999, 67.040001) , p2(45.860001, 57.330002) , p3( 66.370003, 84.169998) , and r1= 5.824241 , r2 = 8.522444 , r3= 28.456253 , the answer is (910813 ,-695906)

enter image description here

Community
  • 1
  • 1
userInThisWorld
  • 1,361
  • 4
  • 18
  • 35

1 Answers1

1

Trilateration works for three non-collinear points. Your points look almost collinear, so some denominator in expressions (I cannot see you code :)) has very small value, and solution is absolutely inexact huge-coordinate point.

MBo
  • 77,366
  • 5
  • 53
  • 86
  • No, they are non col linear (they don't lie in the same line) even they are showing that. – userInThisWorld Nov 07 '15 at 14:59
  • Yes, there is a very small value which is when calculate y in this equation: y = (r12 - r32 + i2 + j2) / 2j - ix / j – userInThisWorld Nov 07 '15 at 15:01
  • But in this case, why it can't estimate the center of the common area!! and how we can calculate intersection point in such cases?! – userInThisWorld Nov 07 '15 at 15:02
  • because this method is intended for above good case, not for degenerate bottom one. Small value causes very big numerical errors, so another approach is needed here. – MBo Nov 07 '15 at 15:09
  • Thanks @MBo, but any idea if there is a technique to determine if the points are good or degenerate before using trailteration? – userInThisWorld Nov 08 '15 at 17:19
  • To find if points are degenerate - calculate triangle area through crossproduct and normalize it dividing by squared longest triangle edge. Small value - degenerate case – MBo Nov 08 '15 at 17:24
  • I have similar problem. but with java. – user3123372 Dec 18 '18 at 14:17