The cosine rule is one of a pair of rules useful in working with triangles. The basic form yields the length of a side when given the lengths of the two other sides, and the included angle - that is the angle between the two sides.

Given a triangle with vertices A,B,C and edges a,b,c opposite their respective angles, the cosine rule can solve the case where we are given two sides and their included angle:

a² = b² + c² - 2bc * cos(A)

In its alternative form, we can solve a triangle when given three side lengths:

cos(A) = (b² + c² - a²) / 2bc

If a triangle is solvable, but not by this rule, then the sine rule may yield an answer.