So far we have looked at the sine and cosine in a right-angled triangle. We will now deal with the law of sines and law of cosines, which have the great advantage of working in each triangle.
In a triangle #ABC# with sides #\blue a#, #\green b# and #\orange c# and angles #\blue \alpha#, #\green \beta#, #\orange \gamma#, the following is true:
\[\dfrac{\sin(\blue \alpha)}{\blue a} = \dfrac{\sin(\green \beta)}{\green b} =\dfrac{\sin(\orange \gamma)}{\orange c}\]
We can draw a helpful line perpendicular to the side #\orange c# through vertex #C#.
Now: #CD=\green{b} \cdot \sin{\blue \alpha}# (sine in right-angled triangle #ADC#)
Also: #CD=\blue{a} \cdot \sin{\green \beta}# (sine in right-angled triangle #BCD#).
Therefore: #\green{b} \cdot \sin{\blue \alpha}=\blue{a} \cdot \sin{\green \beta}# and so #\dfrac{\sin(\blue \alpha)}{\blue a} = \dfrac{\sin(\green \beta)}{\green b}#.
In the same way, we can prove the other equalities by drawing perpendicular lines on side #\blue a# and #\green b# through vertex #A# and #B# respectively.
In a triangle #ABC# with sides #\blue a#, #\green b# and #\orange c# and angles #\blue \alpha#, #\green \beta#, #\orange \gamma#, the following is true:
\[\blue a^2 = \green b^2+\orange c^2-2\green b \orange c\cos(\blue \alpha)\]
\[\green b^2 = \blue a^2+\orange c^2-2\blue a \orange c\cos(\green \beta)\]
\[\orange c^2 = \blue a^2+\green b^2-2\blue a \green b\cos(\orange \gamma)\]
Again, we'll draw a helpful line perpendicular to side #\orange c# through vertex #C#.
According to the Pythagorean theorem:
\[AD^2+CD^2=\green b^2\]
and
\[BD^2+CD^2=\blue a^2\]
So when we substitute #CD^2=\green b^2-AD^2# (the first equality) in the second equality, we find:
\[BD^2+\green b^2-AD^2=\blue a^2\]
Here #BD=\orange c-AD#. This therefore gives us:
\[(\orange c-AD)^2+AD^2-\green b^2=\blue a^2\]
When we expand the brackets, we find:
\[\orange c^2+AD^2-2 \cdot\orange c \cdot AD+\green b^2-AD^2=\blue a^2\]
We can simplify this to:
\[\orange c^2-2 \cdot \orange c \cdot AD+\green b^2=\blue a^2\]
Finally, we note that according to the cosine in a right-angled triangle #AD=\green b \cdot \cos(\blue \alpha)#. Therefore:
\[\orange c^2-2 \cdot \orange c \cdot \green b \cdot \cos(\blue \alpha)+\green b^2=\blue a^2\]
This way we have proved the law of cosine for side #\blue a#. In the same way using perpendiculars to #\blue a# and #\green b#, we can prove the other two laws.

In the above isosceles triangle #a=b=3# and #\gamma=120^\circ# is given. What is the exact length of the base #c# of this triangle? Simplify roots as much as possible.
#c=# #3\sqrt{3}#
According to the law of cosines #c^2=a^2+b^2-2ab\cos\left(\gamma\right)# applies. Entering the given values #a=b=3# and #\gamma=120^\circ# gives #c^2=3^2+3^2-2\cdot3\cdot3\cdot\cos\left(120^\circ\right)=27#. Here we used the fact that #\cos\left(120^\circ\right)=-\cos\left(60^\circ\right)=-\dfrac{1}{2}#. Hence, we find #c=\sqrt{27}=\sqrt{9\cdot3}=\sqrt{9}\cdot\sqrt{3}=3\sqrt{3}#.