Solution (source code)

= Solution

Choose a common origin at vertex $C$, set $\mathbf a=\overrightarrow{CB}$ and $\mathbf b=\overrightarrow{CA}$, and orient the remaining edge as $\mathbf c=\overrightarrow{AB}$. Then
$$
\boxed{\mathbf c=\mathbf a-\mathbf b.}
$$
This convention makes the interior angle between $\mathbf a$ and $\mathbf b$ equal to $C$, and their lengths equal to the opposite side lengths $a$ and $b$.

\Image[/past-exam-of-the-mathematics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2004/paper-2-triangle-vectors.png]
{title=Consistently oriented triangle edge vectors for the sine and cosine rules}
{description=An original illustrative triangle with two vectors from vertex $C$ and their difference from $A$ to $B$. Side labels are opposite the corresponding vertices.}

Take the <dot product> of the difference with itself. Since $\mathbf a\cdot\mathbf b=ab\cos C$, the <law of cosines> follows:
$$
\boxed{c^2=a^2+b^2-2ab\cos C.}
$$
The magnitude of the <cross product> of two edge vectors is twice the triangle's <area> $K$. Applying this at each vertex gives $2K=ab\sin C=bc\sin A=ca\sin B$. Divide by the nonzero product $abc$ to obtain the <law of sines>:
$$
\boxed{\frac{\sin A}{a}=\frac{\sin B}{b}=\frac{\sin C}{c}.}
$$