Let the sides be a, b, and c.
\(c^2 = a^2 + b^2 - 2ab \cos C.\)
You can replace c, a, and b interchangeably. This should help:
https://en.wikipedia.org/wiki/Law_of_cosines