Sunteți pe pagina 1din 5

Mathematics Stack Exchange is a

question and answer site for people


studying math at any level and
professionals in related fields. It only
takes a minute to sign up.

Sign up to join this community

Anybody can ask a question

Anybody can answer

The best answers are voted


up and rise to the top

Find X location using 3 known (X,Y) location using trilateration


Asked 5 years, 1 month ago Active 11 months ago Viewed 17k times

I post this question in stackoverflow here and was advised it was best suited for here.

I am trying to understand the maths behind trilateration, we have 3 access points (AP's: 1, 2, 3)
6
and we know the centre coordinates of theses 3 (AP's). Lost device (X ) is the location where all 3
circle intersect.

example GRID ⇒ x = 30, y = 30.

2 Known Locations: AP 1 = (5, 5), AP2 = (5, 15), AP3 = (20, 10).

Unknown Location: X

Lets say X = (9, 11)

how do we work out the intersection of all 3 circles by the maths.

your help is greatly appreciated.

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
coordinate-systems

edited Dec 30 '17 at 19:45 asked Aug 1 '14 at 16:22


K.K.McDonald Gman
962 6 18 131 1 1 3

3 Answers

Use the distance equation. If your unknown point is (x, y), your known points are (x i, yi ) which are
distances r from your unknown point, then you get three equations:
i

8 2 2 2
(x − x 1 ) + (y − y1 ) = r
1

2 2 2
(x − x 2 ) + (y − y2 ) = r
2

2 2 2
(x − x 3 ) + (y − y3 ) = r
3

We can expand out the squares in each one:


2 2 2 2 2
x − 2x 1 x + x + y − 2y1 y + y = r
1 1 1

2 2 2 2 2
x − 2x 2 x + x + y − 2y2 y + y = r
2 2 2

2 2 2 2 2
x − 2x 3 x + x + y − 2y3 y + y = r
3 3 3

If we subtract the second equation from the first, we get


2 2 2 2 2 2
(−2x 1 + 2x 2 )x + (−2y1 + 2y2 )y = r − r − x + x − y + y .
1 2 1 2 1 2

Likewise, subtracting the third equation from the second,


2 2 2 2 2 2
(−2x 2 + 2x 3 )x + (−2y2 + 2y3 )y = r − r − x + x − y + y .
2 3 2 3 2 3

This is a system of two equations in two unknowns:


By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Ax + By = C
Terms of Service.
Dx + Ey = F
which has the solution:

CE − F B
x =
EA − BD

C D − AF
y =
BD − AE

edited Jun 5 '17 at 19:20 answered Aug 1 '14 at 16:55


John
23.4k 3 27 51

Thanks john, first bit I got and worked R1= 7.2112, R2 = 5.6568, R3 = 11.045. the next bit I'm not sure about
can you explain to me (−2x1+2x2)x+(−2y1+2y2)y+x21−x22+y21−y22=r21−r22. @John – Gman Aug 1 '14 at
18:00

I expanded out the squares in the first two equations. So (x − x ) became x − 2x x + x , for example.
1
2 2
1
2
1

Since the equations all have x + y on the left hand side, subtracting one from another gets rid of them. This
2 2

leaves the linear terms x and y only, which is a lot nicer to deal with. – John Aug 1 '14 at 18:14

I edited my answer to show this explicitly. – John Aug 1 '14 at 18:20

sorry if I sound stupid on this john but I find in order for we to be good at this I need to have a good
understanding of it. so when I punch the numbers in this is how it looks is that correct 9*(-2*5+2*5)+11*

(-2*5+2*5)+5^2-5^2+5^2-15^2 = -200 – Gman Aug 1 '14 at 18:21

do you think you could show me how its done, the solution worked out. I really appreciate your help on this
and any knowledge gained I will pass on to someone else. – Gman Aug 2 '14 at 13:59

I'm investigating the same problem, with an added twist.

I've got information from 3 cell towers about the exact time when they received a signal, down to
0 the nanosecond. But I don't know when the message was sent. So my problem is to look for 3
intersecting circles, that have a common unknown offset added to their radius.

At light speed, every nanosecond allows a radio wave to advance 0.0003 kilometers. I'm
approximating the map of Holland, where all this is happening, as a flat rectangle where every
degree longitude counts for 66 kilometers, while a degree latitude equals 105 kilometers.

I've got these cell tower coordinates, with the time of signal reception:

1. 51.949505 4.545394 Time+46942ns


2. 51.942551 4.497042 Time+51510ns
3. 51.972046 4.595404 Time+58837ns

The online graphing with desmos.com was an awesome find ! Thanks MatMc. It allows me to
quickly draw this situation as : https://www.desmos.com/calculator/gsrvhwvt6o As (x,y)
coordinates, I used the lat/long degrees, which makes it easy to plug any results into Google Maps.
The drawback is that this makes units of both axis different in size, so every real-life circle on the
By usingmap
our site,
getsyou acknowledge
drawn that you have grid
on the mathematical read as
andan
understand
ellipse. our Cookie Policy, Privacy Policy, and our
Terms of Service.
Now what really bothers me, is the appearance of 2 perfect intersections, upon picking the proper
time offsets. I got a razor-sharp location fix for both d=-12.950967 and d=-12.172546 . Earlier on, I
drew some quick circles by hand, and I concluded that the northernmost intersection was the
location. A triangulation van was dispatched, and thankfully they found the signal at that location.
Now I realize that I just got lucky. I could just as well have bumped into the southernmost
intersection, by choosing a different common offset, and then the guys would have found nothing
there.

edited Dec 12 '17 at 12:40 answered Dec 12 '17 at 12:10


user1564286
1 1

I have a solution that works quite well. It involves finding the centroid which will help for scenarios
where the circles don't intersect perfectly.
0 Suppose you have three receivers located at three known points A(0, 0) , B(0, 1) , C (1, 0).

And suppose the the distance from each receiver is known; therefore a circle can be drawn around
each receiver with a radius as follows:

[picture at the end]

a
2
= (x − 0)
2
+ (y − 0)
2
; (red circle)

b
2
= (x − 0)
2
+ (y − 1)
2
; (blue circle)

c
2
= (x − 1)
2
+ (y − 0)
2
; (green circle)

this problem can be understood as drawing lines between the two points at which each circle
intersects. If these three lines are drawn, then they will all intersect at one point.

circle A and circle B intersect when c^2 = a^2. Note that the 'y' term will cancel out and only leave
an 'x' value as follows, which draws a line between them:

x = (1 − c
2 2
+ a )/2 ;

circles A and B intersect when a 2


= b
2
which results in:
2 2
y = (1 − b + a )/2

circles B and C intersect when b 2 2


= c , and let b 2
− c
2
= z :

x = (z + 2y)/2

This will execute trilateration well even if the circles don't intersect perfectly.

Try it out on a website like www.desmos.com, as I did in the picture attached, and play with the
values of a,b,c to see if you make the model better!

This can be further improved..... any sugggestions????


By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
edited Sep 29 '18 at 20:22 answered Mar 31 '15 at 7:52
Senseful Mat Mc

438 1 6 17 1

Here's a mathjax tutorial meta.math.stackexchange.com/questions/5020/… – user103828 Mar 31 '15 at 8:10

@Mat Mc can you send me your working that you did on www.desmos.com/calculator I'd like to see it. Thanks
for the heads up on that site, just what I was looking for. – Gman Apr 1 '15 at 0:23

GMAN: go and give it a try first. step 1: plug the 6 equations into desmos. step 2: give 'a', b', and 'c' values. If
you get lost at plugging the equations in GMAN, look at the picture posted "trilateration picture HERE." Super
easy, you can do it! – Mat Mc Apr 1 '15 at 14:53

Looks like the two missing equations from the screenshot are: a^2 = x^2 + y^2 and x = (b^2 - c^2 +
2y)/2 . Here's a pre-populated version: desmos.com/calculator/dvkm1rovv9 – Senseful Sep 29 '18 at 19:49

By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.

S-ar putea să vă placă și