Let ABC be a triangle, where a is the side opposite vertex A, b is opposite, B and c is opposite C.
Let a be the vector along side a from C to B.
Let b be the vector along side b from C to A.
Let c be the vector along side c from A to B.
Let the unit vectors i and j be parallel and perpendicular to a respecively.
So,
a = ai
and
b = b.cos(C)i + b.sin(C)j
So, by vector addition,
c = -b + a
= -(b.cos(C)i + b.sin(C)j) + ai
= (a - b cos(C))i - b.sin(C)j
Now, the magnitude (ie. length) of c can be determined from its resolved constituents using Pythagoras' Theorem
So:
c2 = (a - b cos(C))2 + (-b.sin(C))2
=> c2 = a2 - 2ab.cos(C) + b2.cos2(C) + b2.sin2(C)
Taking b2 out as a common factor leaves
=> c2 = a2 - 2ab.cos(C) + b2(cos2(C) + sin2(C))
and, using the identity sin2x + cos2x = 1 gives
=> c2 = a2 - 2ab.cos(C) + b2(1)
And, rearranging...
=> c2 = a2 + b2 - 2ab.cos(C)
Which just happens to be the Cosine Rule.
![Big Stupid Grin :biggrin:](./images/smilies/grin.gif)