This article is about the trigonometric identity in planar geometry. For the cosine law of optics, see Lambert's cosine law. For the trigonometric identity in spherical geometry, see Spherical law of cosines.
Fig. 1 – A triangle. The angles α (or A), β (or B), and γ (or C) are respectively opposite the sides a, b, and c.
In trigonometry, the law of cosines (also known as the cosine formula or cosine rule or Al-Kashi’s theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides , , and , opposite respective angles , , and (see Fig. 1), the law of cosines states: