Hi, I hope someone can help me figure out the solution to this problem. I have four ultrasound receivers positioned along two axis. These are the black dots on the blue and orange lines. From these I get a pair of distance measurements a & b from the origin. From these I want to work out an intersection position x,y.
The axis of the receivers is fixed at the angle A= B from the X,Y plane. Should be easy, but my trig is so rusty and I'm so much more concerned with the electronics I hoped a maths guru could point me in the right direction!
Hi, here's my attempt (I hope I understood the problem correctly). Hopfefully others will take a look and check for errors or offer alternative solutions (probably less complicated and cluttered )
I have attached a new illustration to make it easier to follow my approach to the problem. I used greek letters in the illustration but I don't know how to write them here so I just spell them out. Sorry about that, hopefully it's clear enough. Also, there may be some constraints on this solution as far as what angle ranges it is valid but this may give you a start.
Notation:
a the distance given from the origin along the first receiver axis.
b the distance given from the origin along the second receiver axis
ax the projection of a along the x-axis.
bx the projection of b along the x-axis.
alpha the angle between the x axis and the first receiver axis
beta the angle between the x-axis and the second receiver axis
l (lowercase L) extends from the points (-ax, 0) to (bx, 0) on the x-axis
c the segment from point (-ax,0) to (x,y)
d the segment from point (bx, 0) to (x,y)
(note: l, c, and d form a triangle)
delta the angle opposite side d
gamma the angle opposite side c
lambda the angle opposite side l
cx the length of side c projected along the x-axis
cy the length of side c projected along the y-axis
Perhaps I should try and explain the origin of the diagram a bit more. I have four fixed-position Ultrasound receivers (labelled RX) and one moving transmitter (labelled TX). I already do a little bit of trig to work out the distance in mm along each axis (o->A o->B) using the difference in time of flight. If the geometry of the four RX units was set out in a simple 90 degree cross, the job would be done and my two distance measurements would be my final x,y coordinate.
Unfortunately the application dictates the geometry I've shown in the diagram. At least the radius R is identical for all for RX units as is the angle theta from the X and Y axis.
[/QUOTE]
I obviously need to do some more trig using R, theta, A & B to get my final x,y but I can't see how to go about it.
Thankyou wy125 - you posted your reply while I was preparing my second diagram. I think you've interpreted it correctly anyway, and I will have a good look at your solution now. I may ask questions afterwards!
L1(x) = orange line = mx
L2(x) = blue line = -mx
Green line attached to blue line intersects that line at a distance b from the origin going right. This occurs when distance[(L2(x0), x0), origin] = b, or when x0^2+m^2x0^2 = (1+m^2)x0^2 = b^2 -> x0 = b/sqrt(1+m^2). Similarly this happens for the other line (the x coordinate of the intersection is unchanged).
Now construct a line through the point of intersection on the blue line perpendicular to it. This is just P2(x) = x/m + q2 for some q2. Solve for q2: P1(x0) = L1(x0). Similarly P1(x) = -x/m + q2, solving for q2 in the same way.
From here, intersect lines P1 and P2 to get the x coordinate, and then plug that in to either to find the y coordinate.
Plugging the above in to Mathematica with m = sin theta, I got
x = -(1/4) (a + b) (-3 + Cos[2 Theta]) Sec[Theta]
y = -(1/2) (a - b) (-3 + Cos[2 Theta]) Csc[2 Theta]
Note that I've taken a and be to be signed distances. If they correspond to moving to the left, they should be negative, positive to the right.
The time you enjoy wasting is not wasted time. Bertrand Russell
Below is my redo of this problem with the proper slope and better naming conventions. I just did it in Mathematica because it can do the mundane intersection stuff easily. The syntax should be pretty intuitive, and the comments descriptive enough.
This leads to the answer: x = 1/2 (dblue+dorange) Sec(theta) y = 1/2 (-dblue+dorange) Csc(theta)
dblue and dorange are just a and b, but renamed so that dblue is the distance from the origin on the blue line, and similarly with dorange.
The time you enjoy wasting is not wasted time. Bertrand Russell
Interesting, if we differ in the sign of our a's our answers agree. I got to looking at these lines:
ax = a/cos(alpha)
bx = b/cos(beta) = b/cos(alpha)
Shouldn't it be times cos(alpha) instead of divided by? This way ax will be a larger number than a violating the triangle inequality, I think. If this is indeed the difference it's amazing it came out to just a sign convention.
The time you enjoy wasting is not wasted time. Bertrand Russell
no, the divided by is right. Perhaps my notation isn't clear but ax and bx are the distances along the x-axis from the origin made by the perpendicular lines extended from the orange and blue lines. They do not represent the x coordinates of a and b. ax and bx are the hypotenuses in their respective triangles.
In your notation, are a and b positive when they extend toward negative y along the orange and blue lines (just like in the drawing legion drew)?
Ah, I see it now. In my notation, a and b are positive when they extend towards positive x; I guess I disregarded the initial drawing as just an arbitrarily drawn example instead of something representing the usual state of the system (i.e. one where having positive coordinates would be convenient).
If yours require extending negative y to be [edit]positive[/edit], then one of ours should have a reverse sign convention--dorange or a, in fact. So we agree
Last edited by jemidiah; Nov 16th, 2008 at 06:15 PM.
The time you enjoy wasting is not wasted time. Bertrand Russell
That really sounds loke the old Hyperbolic fixing, sorry I don't have the formulas for that. I learned to solve using pencil, divider and "try and error".
However, I have one question: Do you really have only the time-difference between the receptions or do you also have the complete time a signal took to get to any of the recievers. Having the later, the problem would be easily solved, without any *big* mathematic stuff.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button Wait, I'm too old to hurry!
X = (b - a)/2 * sec(alpha)
Y = -(a + b)/2 * csc(alpha)
Seems to do the trick, very pleased indeed! jemidiah, thanks for checking it out as well.
opus, I do have the discrete arrival times to all four sensors - I started out with two sensors, and hence two path times two opposite ends of a baseline using the following to get X,Y: (hope it's right!)
Then I wanted to go full 3D by adding another pair like the first, but the geometry of the space available didn't allow for the second pair to be set at 90 deg and on the same baseline - so I had the idea to use them at a cross angle.
I have an application in which I want to create a 3D space above a midi keyboard (wide but not very deep) for gesture control.