Finding coordinates of unkown point in right angle triangle

Started by
4 comments, last by oliii 17 years, 2 months ago
Hello. I’m trying to find the coordinates of an unknown point (C) in a right angled triangle. Allow me to attempt to demonstrate:

                          _ B
                     __*** |
            AB__***        |
        __***              |BC
  __***                   _|
_*_______________________|_|
A                           C?

I need to find C given A, B, AB and BC

I know the points A and B and therefore know the length of the side connecting them (AB). I also know the length of BC and that there is a right angle at point C. Finding the length of AC using Pythagoras and the unknown angles using trigonometry is trivial. The problem is that I do not know how to find the coordinates of point C efficiently. I already know I can test a circle centred on the midpoint of AB, diameter equal to that sides length, with a circle centred on B, radius equal to the length of BC. I’d prefer to avoid doing this though as it seems like an overkill, and I am hoping for the fastest method as this calculation will be a vital part of a path finding routine and will be called upon hundreds of times in one search (the true problem is finding a tangent to a circle that runs through a given point). Thanks for any help, Jackson Allan.
Advertisement
I'm not quite sure what you mean here. Isn't point C simply at (X of B, Y of A)? Please give us an example of where point C could be relative to any of the other points.
Sorry, my attempted diagram is misleading. The x and y coordinates of the two known points can be anywhere and are probably not going to be aligned with the axis. They could be anything. There are also two solutions to this problem.
This is a link to a site that details the general solution for the intersection of two circles. Using equation (5) you can work out the point on AB where a line perpendicular to AB passes through C. Equation (7) gives the distance along the perpendicular to C. Note that there are two solutions.

Skizz
Thank's for that, but the intersecting circles method is the one I'm already using to solve this problem. I was hoping their would be a method that performs quicker (not involving several square roots).

Edit: I'm having a good read through the link now, please excuse me if I've dismissed it prematurely.
I can see the obvious arccosine (angle(B) = acos(BC / AB)), and generating a point 'D' at the perpendicular of AB at B, and working from that.

It's still not nice.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement