Thread: advanced math problem

  1. #61
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    I'll try and explain the details of my suggestion. Made two sketches in paint, they dont look very good but hopfully you'll understand what Im trying to draw.

    Give the time difference between point A (0,0) and point B (10,0) it's possible to draw arc line and the position of the sender is located somewhere along this arc.
    Sketch of arc
    (This is probably not a very accurate drawing)

    If you then find the same arc between point C (0,10) and point A (0,0) then the two arc will intersect at one point.

    So I need to calculate the arc between point A and point B. If you take a look at this sketch you'll see a snapshoot of one possible solution.

    From the above I made this simple formula :
    y1 + delay = y2

    using pythagorean theorem you can re-write it like this :
    sqrt(a^2 + h^2) + delay = sqrt(b^2 + h^2)

    You can also write 'b' as 'a-10' - so the you can update the above formula :
    sqrt(a^2 + h^2) + delay = sqrt( (10-a)^2 + h^2)

    The I remove the square root on the right hand side by raising both sides to the power of 2

    ( sqrt(a^2 + h^2) + delay)^2 = (10-a)^2 + h^2

    After a bit of tweaking I get this forumla

    sqrt(a^2 + h^2) = (100 - 20a - delay^2) / (2 * delay)

    What I finally end up with is :

    (400a^2 / (4 * delay^2) - a^2 - ((1000a-10*a*delay^2) / delay^2) + (( 100 - delay^2) / (2*delay))^2 - h^2)

    So what I bascilly do is use a simple for loop where I set h=0 and increase it by 0.05 for each iteration, when I have both the delay and h I can insert them into the above forumla and I get an answer (actually you get two answers from a second degree equation, so thats why I have a method call isAnswerCorrect() which checks which answer is correct. Once I've found a I insert it into an array along with h. This process is done form h=0 till h=10 with baby steps of 0,05.

    Not sure if this even makes sense. Please let me know if something was unclear or plain wrong.

    Btw, how do you insert a picture into the post ?

  2. #62
    Geo Geo Geo-Fry
    Join Date
    Feb 2003
    Posts
    116
    i was reading this thread and to me it seems as if you are making it more complicated than it has to be. maybe i missed some important information, but each reciever has an infinint amount of points that are x seconds away (only infinint in a technical sense. in reality there are just a lot. on a graph, there would only be a few, depending on the distance and the size of the grid. but you know what i mean.) so if it takes x time for the signal to get to the reciever, then all the points that are y distance away (y being how far sound travels in x time) would form a circle. if you were to make the circle for two points, one of 4 things would happen:
    a. the two circles are identical. this is not possible since for that to happen they would have to have the same center, and the 4 recievers do not have the same center, so we can eliminate this outcome
    b. the two circles do not intersect at all. in this case there would be no answer, and the problem would be invalid. im assuming that the problem has a solution, so we can eliminate this outcome
    c. the two circles cross at one point. i believe this can only happen if the sender is in the dead center, in which case the times would be the same for the two recievers. if that were the case, it would be immediatly obvious, and we would have no need to even do any solving, so we can eliminate this as a possibility.
    d. the two circles cross at two points. this is only other possibility. so after we find out where they cross, all we need is to make a circle of possibilities at a third reciever, and we have the solution.

    so did i miss something and oversimplify, or what? cuz all that stuff about the arc and physics and what not seems like its overkill on this problem. as for a spefic answer, i dont have one yet, but i didnt want to come up with a solution if im not even solving the problem right.
    "You can lead a man to Congress, but you can't make him think."
    "The Grand Old Duke of York
    -He had ten thousand men.
    -His case comes up next week."
    "Roses are red, violets are blue, I'm schizophrenic, and so am I."
    "A computer once beat me at chess, but it was no match for me at kick boxing."
    "More and more of our imports are coming from overseas."
    --George W. Bush
    "If it weren't for electricity, we'd all be wacthing TV by candlelight."
    --George W. Bush

  3. #63
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I don't think it's as simple as that. We only the difference between receptions by different sensors. We don't actually know ANY of the distances for sure, only the differences between the distances. That's way this problem has taken so much effort.
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cube rotation math problem
    By n3v in forum Game Programming
    Replies: 6
    Last Post: 08-03-2007, 05:41 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. Math Problem....
    By NANO in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 11-11-2002, 04:37 AM
  4. math problem
    By unixOZ in forum Linux Programming
    Replies: 4
    Last Post: 10-19-2002, 12:17 AM
  5. Little math problem
    By Thantos in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-27-2001, 07:44 PM