CorrectOriginally posted by savageag
(2,2)
Care to show me how you solved it ?
CorrectOriginally posted by savageag
(2,2)
Care to show me how you solved it ?
The exact example you gave was actually very easy. If dr2 did not equal dr3 it would be much more difficult.
Since dr2 == dr3 we know that the solution must lie along a line which runs from 1 -> 4. It has to be that way for the signal to arrive at node 2 and 3 at the same time.
Now we know that the distance from 1 -> 4 must be equal to the sq. root of 200. (a^2 + b^2 = c^2) or 14.1421.
So now we must figure out x.
The signal traveled x to node 1, and x + 8.4853 to node 4.
So 14.1421 = 2x + 8.4853
So x = 2.8284
now remember that we know it is on the diagional from 1 -> 4 so use 2.8284 as the hypotinuse of the triangle created between node 1, x2 and the x-axis.
so again with a^2 + b^2 = 2.8284
we know that both sides have the same length so a == b.
This gives us 2a^2 = 2.8284
or a = apx 2
I hope that all made sense. It would be much tougher and require much more calculation if dr2 != dr3. The calculations required would also be much different.
Why are you asking this question, where does it come from?
Thanks again for your reply.Originally posted by savageag
The exact example you gave was actually very easy. If dr2 did not equal dr3 it would be much more difficult.
Since dr2 == dr3 we know that the solution must lie along a line which runs from 1 -> 4. It has to be that way for the signal to arrive at node 2 and 3 at the same time.
Now we know that the distance from 1 -> 4 must be equal to the sq. root of 200. (a^2 + b^2 = c^2) or 14.1421.
So now we must figure out x.
The signal traveled x to node 1, and x + 8.4853 to node 4.
So 14.1421 = 2x + 8.4853
So x = 2.8284
now remember that we know it is on the diagional from 1 -> 4 so use 2.8284 as the hypotinuse of the triangle created between node 1, x2 and the x-axis.
so again with a^2 + b^2 = 2.8284
we know that both sides have the same length so a == b.
This gives us 2a^2 = 2.8284
or a = apx 2
I hope that all made sense. It would be much tougher and require much more calculation if dr2 != dr3. The calculations required would also be much different.
Why are you asking this question, where does it come from?
In retrospect it was maybe a bit easy since two of times were alike. Your example made perfect sense by the way.
If you could be so kind, say we have the same scenario as above only the times are different :
receiver1 : 0
receiver2 : 3.908
receiver3 : 6.3245
receiver4 : 8.2394
What would the position be then ?
Your help is very appreciate by the way. Im stuck so I need some kind of input to get me going again.
Let's take bets.
The prize: A kick in the head.
My guess: (0.5, 3)
The solution if the point is on one of the six lines between the corners is quite simple, but this gets hard.
The answer is (1,3).
I am sorry, but I do not have time to write out the solution right now. I will try to get around to it soon.
I did it using the method I described in detail.
Find two possible solutions for the time differential between node 1 and node 2 and then find the equation for the line connecting the two points. To find possible points just create triangles which are valid ( point one would be node one, point 2 would be node 2, point 3 would be x distance from node one and also x + 3.908 from node 2. If you figure out where that third point is then you know it is a possible solution to the problem from the point of view of just node 1 and node 2.
Do the same thing for node 1 and node 3.
Then just solve for where both lines cross. Each line represents the possible solutions for each node pair, and they only cross in one place, this is the only solution for the 3 nodes.
I hope that made sense.
Now we need the exact answer to see who wins the kick in the head. :-)
Distance from point (1,3) to (0,0) is sq. root of 10 (3.162).
Distance from point (1,3) to (0,10) is sq. root of 50 (7.0710)
time difference is 3.908
Distance from point (1,3) to (10,10) is sq. root of 130 (11.401)
time difference is 8.239
Distance from point (1,3) to (10,0) is sq. root of 90 (9.4868)
time difference is 6.324
-SavageAg
To the original poster, have you ever studied earthquakes? If not, you just found the same procedure that is used to find the epicenter of earthquakes. Different stations make measurements and draw circles according to the data. Using the intersections of the circles, one is able to find the epicenter of the earthquake.
Damn and blast. I so wanted that kick in the head.
Pretty good for an educated guess anyway.
Seriously you're a pretty smart fellow. Is there an algorithm to solve this or did you just start from the probable place and 'brute force' it to get the result?
After much more work, I am more confused instead of less confused. I was feeling pretty smart myself, now I mostly just feel dumb now.
I still think that my (1,3) answer is correct, but cannot make it work out with the method I made up which I thought would be able to work out any problem of this type.
I thought that if you knew the time differential between two points and the distance between two points then you would be able to construct a straight line with all of the possible places where the tranmitter could be relative to only those two nodes. Then if you did that for one of the same nodes and another node you would have another line of possible outcomes between those two nodes. Then it would just be as simple as finding the intersection of the two lines. This seems to not be the case. The lines don't seem to come out as straight.
I will think on it more and post back if I am struck by some genius.
-SavageAg
I agree with this. Have a look at the attached picture, that's an approximation of something I drew out with a compass and a ruler. Basically, given a certain relationship between the length between each black dot and the object, possible points could lie on that line. So we don't have a linear equation.The lines don't seem to come out as straight.
How you obtained your answer, I don't completely understand yet. I'm going to have another look at that post.
To me, the line that I found almost looked like an negative absolute linear function. Could this be helpful?
benforbes@optusnet.com.au
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
My theory came close and I figured I was off by rounding. I checked the answer by plugging in the info and (1,3) seemed correct.
Wish there was a better story. This darn problem is keeping me up much later than I should be up.
I was just thinking about this, and I thought maybe it's impossible to pin it down to one solution. I mean, let's think about what we know. We know that distance BO is x bigger than distance AO, CO is y bigger than BO, and DO is z bigger than CO. Wouldn't there be a number of different ways (ie solutions) that would result in this situation, with the same x, y, and z values?
benforbes@optusnet.com.au
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
I was tossing up whether not to post this for a few days and amaze everyone by solving any timeset within 30 seconds but that sounded too mean.
When all else fails, brute force wins! To that end I wrote a program that brute forces the problem. I will post the code here and attach a Windows executable for people who can not compile ANSI C. Note that this program gives the answer to the above problem as (3,1). This is because you are calling the bottom left station 2 while I am calling the top right station 2. The original poster, please feel free to give this program to your proffessor as an answer!
Please feel free to post corrections to the code. I haven't tested it much as I can't be bothered working out values to test it with.
P.S Surely there must be a non brute force way to do this!Code:#include <stdio.h> #include <math.h> int main() { const double GRID_SIZE_X = 10; // Size of the grid accross const double GRID_SIZE_Y = 10; // Size of grid down /* Set smaller for accuracy or bigger for speed. * A good value is 1 or 0.1 */ const double GRID_GRANUALITY = 0.1; /* Time difference between signal received at station 1 (top left) * and station 2 (top right) */ double dblTime1To2; /* Time difference between signal received at station 1 (top left) * and station 3 (bottom left) */ double dblTime1To3; double dblDistanceToPtOne, dblDistanceToPtTwo, dblDistanceToPtThree; double dblClosestMatch = 1000000; double dblMatchAccuracy, x, y; // Get user provided timings... printf("Please enter the time taken for the signal to reach " "station two(top right) after it reached station one(top left). " "If you enter -99 the default value of 3.9088 will be used.\n"); scanf("%lf", &dblTime1To2); printf("\nPlease enter the time taken for the signal to reach " "station three(bottom left) after it reached station one(top left). " "If you enter -99 the default value of 6.3245 will be used.\n"); scanf("%lf", &dblTime1To3); printf("\n"); getchar(); // Set default values... if (dblTime1To2 == -99) dblTime1To2 = 3.9088; if (dblTime1To3 == -99) dblTime1To3 = 6.3245; // Now do our stuff... for (x = 0; x <= GRID_SIZE_X; x += GRID_GRANUALITY) { for (y = 0; y <= GRID_SIZE_Y; y += GRID_GRANUALITY) { // Work out the 1-2 triangle for this point... dblDistanceToPtOne = sqrt(pow(x, 2) + pow(y, 2)); dblDistanceToPtTwo = sqrt(pow(GRID_SIZE_X - x, 2) + pow(y, 2)); // Now calculate the triangle for points 1 to 3(lower left)... dblDistanceToPtThree = sqrt(pow(x, 2) + pow(GRID_SIZE_Y - y, 2)); // Check how closely the triangles match - the closer to 0, the better... dblMatchAccuracy = fabs(dblDistanceToPtTwo - dblDistanceToPtOne - dblTime1To2) + fabs(dblDistanceToPtThree - dblDistanceToPtOne - dblTime1To3); // if this combination is better than others use it... if (dblMatchAccuracy < dblClosestMatch) { dblClosestMatch = dblMatchAccuracy; printf("-->New closest match: (%.2f, %.2f)\n Accuracy: %.9f\n\n", x, y, dblMatchAccuracy); } } } printf("Press ENTER to continue..."); getchar(); return 0; }
EDIT: Fixed bugs, improved accuracy.
EDIT: Deleted attachment as I don't want to keep updating it. Compile the code yourself.
Last edited by anonytmouse; 09-18-2003 at 01:25 AM.
So does this mean there's only one solution?
BTW, nice program, I guess brute force can solve anything. Hopefully we can find an algebraic solution.
benforbes@optusnet.com.au
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials