Results 1 to 17 of 17

Thread: Determining possible locations from two points

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    1

    Determining possible locations from two points

    I have 2 points, and i know those two points distance from the location im trying to find. From that data i need to find a 3rd points location.

    Such as 6,8 is 5 from the location, and 0.0 is also 5 from the location. So it could be at 3,4.


    I just cant figure out the math to do it. Ive been trying to derive it from the distance formula but its not working.

    Thanks for any suggestions or help.

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Determining possible locations from two points

    I had Mathematica find the analytical solution to your question and it's remarkably ugly (like, when simplified it's half a page long). If you're doing this for some numerical program, you could use an iterative method to solve the function f(x1, y1) = (x3-x2)(2x1+x2+x3) + (y3-y2)(2y1+y2+y3) = 0,* though you'd have to add another constraint in there. Perhaps you could simply solve the initial system iteratively.

    The return Mathematica gives, if you're interested, is attached. The format should be pretty readable, if somewhat puzzling the first time.

    Finally, you could use the following to find a sequence of back substitutions (which would presumably reproduce Mathematica's brute force answer). Take the line connecting the two circle's centers. On the midpoint, make another line perpendicular to the first. It must intersect these two points. Solve for x1 in terms of y1 using the line you just generated, and substitute that into either distance equation (Eq. 1 or 2 below). Solve the resulting quadratic for x1, and resubstitute for y1. Bam, you're done.

    *Derivation:
    (x1-x2)^2+(y1-y2)^2 = R^2
    (Eq. 1) x1^2-2x1 x2 + x2^2 + y1^2 - 2y1 y2 + y2^2 = R^2
    (Eq. 2) x1^2-2x1 x3 + x3^2 + y1^2 - 2y1 y3 + y3^2 = R^2

    2x1 (x3-x2) + x3^2-x2^2 + 2y1(y3-y2) + y3^2-y2^2 = 0
    2x1 (x3-x2) + (x3-x2)(x3+x2) + 2y1(y3-y2) + (y3-y2)(y3+y2) = 0
    (x3-x2)(2x1+x2+x3) + (y3-y2)(2y1+y2+y3) = 0
    Attached Images Attached Images  
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Determining possible locations from two points

    No need for quadratic equations.
    I don't have time to write the proof, but this image should be clear enough.

  4. #4
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Determining possible locations from two points

    Are you saying that the two triangles drawn are similar? That's definitely true since the lines are perpendicular. But, the constant of proportionality between the two triangles changes depending on the radius of the circles. Finding that constant and then interpolating along that line is the challenging part in my mind, which is effectively what my "Finally..." paragraph said. I'm pretty sure you need a quadratic in there somewhere, though I might be wrong.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  5. #5
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Determining possible locations from two points

    I have updated the image with additional labels.

    The length of BC is given, as are the locations of A and B.
    M is the midpoint of AB, and N is obviously (Bx, Ay).
    AB = Sqr(AN2+BN2)
    BM = AB/2
    MC = Sqr(BC2-BM2)
    MC/AB = MO/BN = CO/AN

    Cx = Mx - MO
    Cy = My + CO

    Dx = Mx + MO
    Dy = My - CO

    Note that this still works if AC <> BC, though a bit more work needs to be done to get the location of M.

    MC2+AM2=AC2
    MC2+BM2=BC2
    AM2-BM2=AC2-BC2
    (AM+BM)(AM-BM)=AC2-BC2 | AM+BM=AB
    AM-BM=(AC2-BC2)/AB

    (AM+BM)-(AM-BM)=2BM
    AB-(AC2-BC2)/AB=2BM

    BM = (AB2+BC2-AC2)/2AB

  6. #6
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Determining possible locations from two points

    What the are you talking about?

    That does sound like an easy to solve triangle problem!
    The two distances that are stated are two sides of the triangle, the connecting line of those known points is the third. What you don't have are the angles, but that is an standard triangle problem (called SSS!)

    BTW, you will find either no point (the circles of the distances given do not touch), one point (the circles do just touch, in this case the sum of the distances is equal to the distance of the given points) and you can have two points!
    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!

  7. #7
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Determining possible locations from two points

    You don't need the angles. My image illustrates the right-triangle geometry of the problem. The solution requires only the Pythagorean theorem, along with proof of similarity.

  8. #8
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Determining possible locations from two points

    I can't see how you could do it using Logos illustration without the angles. That's basically a rotation problem. You're rotating the x-y axis so that the x-axis lies on the line connecting points A and B. The solution then will depend upon the angle between the original x-axis and the rotated one.

  9. #9
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Determining possible locations from two points

    We're not rotating anything. The red lines are parallel/perpendicular to the x- and y-axes.

  10. #10
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Determining possible locations from two points

    What I'm saying is that I don't think you can calculate MO and CO without using in some form the angle between AB and and AN.

  11. #11
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    Re: Determining possible locations from two points

    I stand corrected. I missed the similar triangle part. That's a nice solution.

  12. #12
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Determining possible locations from two points

    Yup, those equations Logophobic gave in the first half of post #5 can be solved easily enough to give the coordinates of intersection. I would be very, very surprised if, when completely back substituted and simplified, they weren't equivalent to the awful answers Mathematica gave from my first post. It also does involve a quadratic (the two applications of the Pythagorean Theorem), though solving it in this case was trivial. The geometric approach is nice and pretty there, good idea .

    I'm not really sure what you were doing in the second half of that post, though, Logo. Your expressions presuppose that AMC and BMC are still right triangles when AC<>BC. They're not; you'd need to add an extra term by applying the Law of Cosines instead. I'm pretty sure the geometric approach in that case would get awful.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  13. #13
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Determining possible locations from two points

    Quote Originally Posted by jemidiah
    I'm not really sure what you were doing in the second half of that post, though, Logo. Your expressions presuppose that AMC and BMC are still right triangles when AC<>BC. They're not;
    I disagree, even if AC and BC have different values, the line connecting c and will always be perpendicular to AB. You probably missed the point that D would be moved accordingly!
    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!

  14. #14
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Re: Determining possible locations from two points

    AMC and BMC are right triangles by definition: MC is an altitude of ABC. Point M is not necessarily the midpoint of AB, though this is the case when AC = BC. I was showing how to get the length of BM, with which we can determine the coordinates of point M. Note that when AC = BC, the equation simplifies to BM = AB/2.

  15. #15
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Determining possible locations from two points

    Doh! Yup, you're both right. I think I saw M and had "midpoint" stuck in my mind.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  16. #16
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: Determining possible locations from two points

    I come to think we lost the starter of this threat :-)
    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!

  17. #17
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Determining possible locations from two points

    We may well have. Or, they might not have checked back on this board; happens sometimes. @OP: please feel free to ask for more explanations if you happen to read this and were anxious or something.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width