Hi...
I want to do the following using Matlab.
I want to localize a point on 2D plane using trilateration which demands for the distance measure between the unknown point and three known locations. Here is how i have done it(but i think its quite weird way of doing it)
As the unknown point is only "assumed" to be unknown and infact we can get coordinates of that point, I used those coordinates to measure the distance and then used that distance in the trilateration algorithm to get the same coordinates. Please find my code in the attached file or at the end of this question.
Time stamps combined with the propagation speed can be used to measure distance between two points but again we must know the locations of the two points in order know the time of reception of a message. I think similar goes for RSSI.
Please suggest how should i do this. The following is the code for trilateration.
%Trilateration
%coordinates of the known nodes A,B,C
xa=0; ya=0;
xb=4; yb=0;
xc=2; yc=-4;
%coordinates of the node on unknown location
x=2; y=5;
% Find distances from the unknown node location to all the 3 transmitters:
da = sqrt((x-xa)^2+(y-ya)^2);
db = sqrt((x-xb)^2+(y-yb)^2);
dc = sqrt((x-xc)^2+(y-yc)^2);
va = ((db*db-dc*dc) - (xb*xb-xc*xc) - (yb*yb-yc*yc)) / 2;
vb = ((db*db-da*da) - (xb*xb-xa*xa) - (yb*yb-ya*ya)) / 2;
temp1 = vb*(xc-xb) - va*(xa-xb);
temp2 = (ya-yb)*(xc-xb) - (yc-yb)*(xa-xb);
% Estimated user position:
yE = temp1 / temp2;
xE = (va - y*(yc-yb)) / (xc-xb);