Quote:
Problem the next: Consider a system consisting of three receivers fixed at the corners of a triangle of some given size (about 40cm on a side in this case, if that's relevant). Above this triangle in such a way that it forms a pyramid is a single transmitter. This can move in three axes, but will always remain above the plane formed by the three receivers. Additionally, the movement of the transmitter is essentially in a plane parallel to the plane of the triangle for the most part, but that plane can move towards and away from the receiver plane within certain limits.

The raw output of the system is an absolute distance from the transmitter to each of the receivers. The desired processed output is an X,Y coordinate pair for each set of measurements. Think of the transmitter as the handle of a joystick, the vertical axis of which is parallel to the plane of the triangle. I want to get the output of that joystick.

This one is a fairly simple problem. You know the 3D co-ordinate positions of the three receivers (x0,y0,z0) (x1,y1,z1) (x2,y2,z2), or you might set x0=y0=z0=0 as your origin, then z1=z2=0 for z=0 as the receivers' plane, then y1=0 for your x axis. You want to know (xt,yt,zt) which is the 3D position of the transmitter. And you know the three distances d0,d1,d2 from the receivers to the transmitter. So plug them into 3D Pythagoras:

(x0-xt)^2 + (y0-yt)^2 + (z0-zt)^2 = d0^2
(x1-xt)^2 + (y1-yt)^2 + (z1-zt)^2 = d1^2
(x2-xt)^2 + (y2-yt)^2 + (z2-zt)^2 = d2^2

But lots of the {x,y,z}n are zero, so

xt^2 + yt^2 + zt^2 = d0^2 (Eqn A)
(x1-xt)^2 + yt^2 + zt^2 = d1^2 (Eqn B)
(x2-xt)^2 + (y2-yt)^2 + zt^2 = d2^2 (Eqn C)

Subtract Eqn B from Eqn A and you can solve for xt.

x1^2 - 2*xt = d0^2 - d1^2

Then subtract Eqn B from Eqn C, plug in xt, and you can solve for yt. Then plug those in to Eqn C and solve for zt. (You'll find that zt comes out as sqrt(something), so you'll have to use your knowledge the mechanics of the system to work out whether it's positive or negative.)

Peter