# Return x; y; coordinates of vertex C of triangle

I would like to return the XY coordinates of vertex C using math formula. I have 5 input data what I always know and can be used for solution (green in the image): I know X; Y; coordinates of point A and point B (Ax, Ay, Bx, By), and I know the length of all three sides of triangle (AB, AC, AD). Please help how to get the values of X Y coordinate of point C, what is 70/30 in the example, but I have no formula to get back them.

I know that more than one solution of this formula, but:

• Coordinates cannot be in negative areas. All coordinates must be positive.
• I always use 1 direction for vertex labelling, but because I always know the length of AC and BC, I think to change the label from A to B will not change the position of C.

Thanks!

• math.stackexchange.com/questions/187107/… Jul 24, 2017 at 9:12
• I tried to implement this to my inputs but not succeed. Jul 24, 2017 at 10:40
• Please show what you tried to implement. Are you familiar with all the necessary mathematics used here? Can you solve this problem by hand? Jul 26, 2017 at 17:04

You can get the coordinates of C by using circle equations for one circle C_A with point A as center and AC as its radius and one circle C_B with point B as its center and BC as its radius.

Now you can calculate their intersection points, which leaves you with 2 points (iff C is not on a line between A and B).

I am not entirely sure how you want to determine which of the two candidates C_1 and C_2 is the correct one. If I understand correctly, you always label the triangle counterclockwise. There is a neat way to check this, so you should have everything to find your point.

There are several ways of doing this, the circle intersection way is by no metrics the easiest way. If you have any standard vector maths library available then the simpest way in my mind is as follows:

• Calculate the direction vector a-b, by subtracting vector a from vector b. Then normalize this vector then multiply it by length of b-c
• calculate the angle at corner b
• rotate the vector calculated by 180 +- the angle. (There are 2 solutions).
• add b to that vector. And you are done.

As mentioned by previous answers, the best way to solve your issue is to compute the intersections of the two circles centered at A and B. Since you will have two candidates, you will need to choose a specific order for your edges to only select one candidate.