Katana VentraIP

Law of cosines

In trigonometry, the law of cosines (also known as the cosine formula or cosine rule) 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:

This article is about the trigonometric identity. For the cosine law of optics, see Lambert's cosine law.

The law of cosines generalizes the Pythagorean theorem, which holds only for right triangles: if is a right angle then and the law of cosines reduces to


The law of cosines is useful for solving a triangle when all three sides or two sides and their included angle are given.

the third side of a triangle if two sides and the angle between them is known:

the angles of a triangle if the three sides are known:

the third side of a triangle if two sides and an angle opposite to one of them is known (this side can also be found by two applications of the ):[a]

law of sines

The theorem is used in solution of triangles, i.e., to find (see Figure 3):


These formulas produce high round-off errors in floating point calculations if the triangle is very acute, i.e., if c is small relative to a and b or γ is small compared to 1. It is even possible to obtain a result slightly greater than one for the cosine of an angle.


The third formula shown is the result of solving for a in the quadratic equation a2 − 2ab cos γ + b2c2 = 0. This equation can have 2, 1, or 0 positive solutions corresponding to the number of possible triangles given the data. It will have two positive solutions if b sin γ < c < b, only one positive solution if c = b sin γ, and no solution if c < b sin γ. These different cases are also explained by the side-side-angle congruence ambiguity.

a2, b2, and c2 are the areas of the squares with sides a, b, and c, respectively;

if γ is acute, then ab cos γ is the area of the with sides a and b forming an angle of γ′ = π/2γ;

parallelogram

if γ is obtuse, and so cos γ is negative, then ab cos γ is the area of the with sides a and b forming an angle of γ′ = γπ/2.

parallelogram

Polyhedra[edit]

The Law of Cosines can be generalized to all polyhedra by considering any polyhedron with vector sides and invoking the Divergence Theorem .[16]

Half-side formula

Law of sines

Law of tangents

Law of cotangents

List of trigonometric identities

Mollweide's formula

, Encyclopedia of Mathematics, EMS Press, 2001 [1994]

"Cosine theorem"

at cut-the-knot

Several derivations of the Cosine Law, including Euclid's

Interactive applet of Law of Cosines