Cosine Rule (with proof)

$\textcolor{red}\text{%n=%v}$

$\textcolor{green}\text{%n=%v}$

D

\large{h}

\large{x}

A

B

a

C

b

none

\large{c - x}

Show Proof

$\mathsf{\text{In general}}\;$$\mathsf{\text{\textcolor{0,0,255}{a}^2=\textcolor{0,153,0}{b}^2+\textcolor{204,0,0}{c}^2\minus2\,\textcolor{0,153,0}{b}\textcolor{204,0,0}{c}\cos{\textcolor{0,0,255}{A}}}}$

$\mathsf{\text{By symmetry}}\;$$\mathsf{b²=a²+c²-2ac\cos{B}}$\;also\;$\mathsf{c²=a²+b²-2ab\cos{C}}$

\large{c}

\textcolor{102,0,102}\mathsf\text{Drag the \textcolor{red}{red} points at \textcolor{0,0,255}{A} and \textcolor{204,0,0}{C}.

From △ ACD we get x = b cosA and h² + x² = b²
In △ BCD a² = h² + (c - x)² 
                     = h² + x² + c² - 2cx
                     = (h² + x²) + c² - 2c(x)
By substituting h² + x² with b², and x with b cos A, we get
a² = b² + c² - 2c(b cos A) rewritten as
a² = b² + c² - 2bc cos A

A = Point(xAxis)
C = (-6.298918612871807, 4.60541359870199)
B = Point(xAxis)
poly1, c, a, b = Polygon(A, B, C)
d = OrthogonalLine(C, c)
D = Intersect(d, xAxis)
e = Segment(C, D)
α = Angle(B, A, C)
β = Angle(C, B, A)
γ = Angle(A, C, B)
f = Segment(D, A)
text1: "A = " + α
text2: "B = " + β
text3: "C = " + γ
E = Midpoint(a)
F = Midpoint(c)
G = Midpoint(b)
text4: "a = " + a
text5: "c = " + c
text6: "b = " + b
δ = Angle(A, D, C)
H = Midpoint(e)
I = Midpoint(f)
g = false
J = Midpoint(D, B)
h = 1
text12: "Therefore " + text4 + ""
M = (-14.865263982693309, 6.662685518226059)
N = (-12.066025141373684, 6.696411287398585)
text21: "$\mathsf{\textcolor{0,0,255}{a}^2=}\;$$\mathsf{\textcolor{0,153,0}{b}^2+\textcolor{204,0,0}{c}^2-2\textcolor{0,153,0}{b}\textcolor{204,0,0}{c}\cos{\textcolor{0,0,255}{A}}=}\;$$\mathsf{\textcolor{0,153,0}{" + (LaTeX[b]) + "}^2+\textcolor{204,0,0}{" + (LaTeX[c]) + "}^2-2\;×\;\textcolor{0,153,0}{" + (LaTeX[b]) + "}\;×\;\textcolor{204,0,0}{" + (LaTeX[c]) + "}\;\cos\textcolor{0,0,255}{{" + (LaTeX[α]) + "}}=" + (LaTeX[b^(2) + c^(2) - (((2 * b) * c) * cos(α))]) + "}$"