I want to plot a triangle, given side lengths $a$, $b$, and $c$.
I can plot point $A$—opposite side $a$—at the origin $(A_x = 0,\ A_y = 0)$.
I can plot point $B$—opposite side $b$—along the $x$-axis at $(B_x = c,\ B_y = 0)$.
My goal is to solve for the coordinates $(C_x,\ C_y)$ for any triangle. I understand there will be two possible solutions: one where the triangle “points up” and one where the triangle “points down”. I am only interested in the solution where $C_y$ is positive.
Please provide a solution in the form:
$C_x =$
$C_y =$
The points $C_x$ and $C_y$ satisfy the following system of equations:
\begin{align} \sqrt{C_x^2+C_y^2}&=b\\ \sqrt{(c-C_x)^2+C_y^2}&=a \end{align}
Square both equations and substitute so that you are left with a linear expression for $C_x$. In other words,
\begin{align} C_x^2+C_y^2&=b^2\\ c^2-2cC_x+C_x^2+C_y^2&=a^2 \end{align}
Then, by substitution and rearranging, you have that $$ C_x=\frac{a^2-b^2-c^2}{-2c} $$
Then, substitute and solve for $C_y$. $$ C_y=\sqrt{b^2-C_x^2}. $$