# How to find coordinates of 3rd vertex of a right angled triangle when everything else is known?

I want to locate precisely the 3rd coordinate of a right angled triangle. I have:

1. the length of three sides
2. The three angles
3. The other two coordinates of the triangle

The triangle can lie in any orientation in 2D coordinate system.

The three sides, angles and coordinates could be different in the piece of experiment and I am not working with any fix pair of values... I am actually dealing with multiple pairs of all above mentioned values.

I need a reliable and accurate way of finding the 3rd coordinate. Currently I have this formula but it calculated two pairs of coordinates (forming a butterfly) instead of the triangle.

## Edit 2:

In the diagram that I mentioned and to which a (potential) solution has been presented, I have a confusion/connected question (because I believe this could be the cause of the problem).

## Question:

Can $(x_1, y_1)$ and $(x_2, y_2)$ be any pair of the right angles triangle? or does $(x_1, y_1)$ must the coordinates of the right angle and $(x_2, y_2)$ for the base vertex?

## Currently I get this:

As you can see, the coordinate I am trying to get is draw way-off the border of the circle. The coordinate should be found on the border of the circles and not that far away in space.

As you might have guessed that I am trying to draw tangents between each circle. I have worked out rest of the code but the coordinate is being calculated incorrectly and thus the right angled triangle is formed incorrectly..

I want to find only ONE triangle instead of the four possibilities.

http://awaismunir.net/universal/tangents/3rd-third-vertext-calculate-right-angled-triangle.gif

## Note:

I have already reviewed these urls:

Calculate coordinates of 3rd point (vertex) of a scalene triangle if angles and sides are known.

and

How to find the third coordinate of a right triangle given 2 coordinates and lengths of each side

Kindly help.

Thanks!

Steve

• I don't quite understand the defect of the equation you give. Are you concerned by the $\pm$ ambiguities? As far as I can see, that's because there are four right triangles you could draw based on having two coordinates and the lengths. To eliminate the ambiguity, you'll need to use the angles (both magnitude and signs.) – Semiclassical Sep 11 '14 at 17:24
• and i am wondering how can i utilize the angles? I have all the angles but i dont know which formula i can use? I want to find one triangle and not four and i am wondering if knowing the angles and all sides give me any advantage? if yes can you give any formula that i can use and find only ONE triangle? – Steve Johnson Sep 11 '14 at 17:30
• @Semiclassical: Only two right triangles, corresponding to the two possible orientations. The other two combinations (namely those where both signs are chosen the same) have one coordinate from one triangle and the other from the other. – MvG Sep 11 '14 at 18:35

If you always want the $(x-x_1,y-y_1)$ vector to be rotated $90°$ counter-clockwise against the $(x_2-x_1,y_2-y_1)$ one, then you have

\begin{align*} n(x-x_1) &= m(y_1-y_2) \\ n(y-y_1) &= m(x_2-x_1) \end{align*}

So the left $y$ difference is the right $x$ difference, and the left $x$ difference is the negative of the right $y$ difference. This amounts to the $90°$ rotation I mentioned.

Solve the above and you find

\begin{align*} x &= \frac{m(y_1-y_2)}n+x_1 \\ y &= \frac{m(x_2-x_1)}n+y_1 \end{align*}

which corresponds to one of your four solutions.

• In the diagram that i mentioned and to which you presented your solution, i have a confusion. Can x1,y1 and x2,y2 be any pair of the right angles triangle? or does x1,y1 must the coordinates of the right angle and x2, y2 for the base vertex? – Steve Johnson Sep 12 '14 at 14:49
• Turns out, i was using the right formula, but i had to consider the right alignment. i.e. Choosing the correct perpendicular and base lengths to pass into the formula. – Steve Johnson Oct 24 '14 at 13:40