The Law of Cosines relates the three side lengths of a triangle with the cosine of one of its angles. If this angle, call it , is formed by sides and and opposite side , then the law of cosines states that . When , the last term is zero, giving the Pythagorean theorem as a special case.