# How can I draw a triangle and find the length of its height?

Given that the sum of three inner angles $$a,b$$ and $$c$$ in a triangle is $$\pi$$, and knowing that：

$$2 \sin(a−c) = \sin b,$$ $$a+b=3c,$$

how can I draw this triangle and find the length of the height on side AB?

The length of AB is equal to 5

Based on a previous comment from @cvgmt, I can find $$\sin a$$ with:

Reduce[{2 Sin[a - c] == Sin[b], a + b == 3 c, a + b + c == π,
t == Sin[a], {a, b, c} > 0}, t, {a, b, c}] // FullSimplify
(* t == 3/Sqrt[10] *)


In the following code, I calculate cotA and cotB, then calculate the length of the height above AB edge:

Reduce[{2 Sin[a - c] == Sin[b], a + b == 3 c, a + b + c == π,
t == Sin[a], {a, b, c} > 0}, t, {a, b, c}] // FullSimplify
(* t == 3/Sqrt[10] *)

Reduce[{2 Sin[a - c] == Sin[b], a + b == 3 c, a + b + c == π,
t == Sin[a], {a, b, c} > 0}, {t, c}, {a, b}] // FullSimplify
(* t == 3/Sqrt[10] && 4 c == π *)

Reduce[{Sin[a] == 3/Sqrt[10], Sin[a]^2 + Cos[a]^2 == 1,
cotA Sin[a] == Cos[a]}, cotA, {Cos[a], Sin[a]}]
(* cotA == -(1/3) || cotA == 1/3 *)

Reduce[{Sin[a] == 3/Sqrt[10], Cot[a] == 1/3, 4 c == π,
a + b + c == π, Sin[b]^2 + Cos[b]^2 == 1,
cotB Sin[b] == Cos[b]}, cotB]
(* C[1] ∈ Integers &&
a == 2 ArcTan[1/3 (-1 + Sqrt[10])] + 2 π C[1] &&
b == -a + (3 π)/4 && c == π/4 && cotB == 1/2 *)

AB = 5
(* 5 *)

cotA = 1/3
(* 1/3 *)

cotB = 1/2
(* 1/2 *)

h = AB/(cotA + cotB)
(* 6 *)


Can the calculation above be optimized? Or is there a better way?

Also, how can I draw this triangle based on the known conditions and calculated data?

• Why not just use AASTriangle and friends: sol = FullSimplify@Solve[{ 2 Sin[a - c] == Sin[b], a + b == 3 c, a + b + c == \[Pi], a > b > c, t == Sin[a]}] /. C[1] -> 0; tri = AASTriangle[a, b, t] /. sol; Graphics[tri] Commented Jun 7, 2023 at 13:02
• @flinty This triangle is filled with black inside. How to draw only three edges and three corners Commented Jun 7, 2023 at 13:34
• @csn899 Look for FaceForm[None] and EdgeForm[your color]! Commented Jun 7, 2023 at 15:12

Clear["Global*"];
sol = First@
Solve[{2 Sin[a - c] == Sin[b], a + b == 3 c,
a + b + c == π, {a, b, c} > 0}, {a, b, c}];
ab = 5;
{A1, B1, C1} = First@ASATriangle[a, ab, b] /. sol;
H1 = RegionNearest[Line[{A1, B1}], C1];
labels = {Text[Style[A, FontFamily -> "Times", 15], A1, {2, 0}],
Text[Style[B, FontFamily -> "Times", 15], B1, {-2, 0}],
Text[Style[C, FontFamily -> "Times", 15], C1, {2, -1}],
Text[Style[H, FontFamily -> "Times", 15], H1, {0, 1}]};
Graphics[{FaceForm[], EdgeForm[Black], ASATriangle[a, ab, b] /. sol,
labels, Dashed, Line[{C1, H1}]}]


• The length of the height on side AB is
EuclideanDistance[C1, H1] // FullSimplify
ArcLength[Line[{C1, H1}]] // FullSimplify
RegionDistance[Line[{A1, B1}]]@C1 // FullSimplify


6.

6.

6`.