How to plot a triangle, given three side lengths?

2k Views Asked by At

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 =$

3

There are 3 best solutions below

0
On BEST ANSWER

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}. $$

0
On

if you know point $a,b$ then lets assume $C(x,y)$ so by distance formula you'll get two equations solve for indivdual $x,y$

1
On

By the law of cosines, where $\alpha$ is the triangle at point $A$,

$$a^2=b^2+c^2-2bc\cos\alpha$$ so $$\cos\alpha=\frac{b^2+c^2-a^2}{2bc}$$

Then, since side $b$ is the hypotenuse of a right triangle with leg $C_x$ adjacent to angle $\alpha$,

$$C_x=b\cos\alpha=\frac{b^2+c^2-a^2}{2c}$$

Since the other leg of that right triangle is $C_y$, by the Pythagorean theorem we get

$$C_y=\sqrt{b^2-C_x^2}=\sqrt{b^2-\left(\frac{b^2+c^2-a^2}{2c}\right)^2}$$

If you think that formula for $C_y$ is too messy, you could find another one by using two formulas for the area of the triangle, the second given by Heron's formula. Here $s=\dfrac{a+b+c}{2}$ is the semiperimeter of the triangle.

$$\frac 12bC_y=\sqrt{s(s-a)(s-b)(s-c)}$$ so

$$C_y=\frac{2\sqrt{s(s-a)(s-b)(s-c)}}{b}$$

As a bonus, the formula for $C_x$ gives you the cosine of the angle at $A$ and the second formula for $C_y$ gives you the area of the triangle.