The law of sines and law of cosines, connecting a triangle's side lengths to its angles.
IntuitionVisual intuition
A triangle has six measurements — three side lengths and three angles — but they are not independent: fixing some of them pins down all the rest. If you know two sides and the angle between them, the law of cosines hands you the third side directly, generalizing the Pythagorean theorem to triangles that are not right-angled. If instead you know one side and its opposite angle, the law of sines lets you scale that relationship to every other side-angle pair, and even tells you the radius of the circle that passes through all three vertices.
A triangle with its circumscribed circle, the perpendicular bisectors of its sides meeting at the circumcenter O, and dashed radii OA, OB, OC; a note gives the radius R.
A triangle ABC and its circumscribed circle, centered at O with radius R (the perpendicular bisectors of the sides meet at O). The law of sines links every side to its opposite angle through this same radius: sinAa=sinBb=sinCc=2R. The slider moves vertex A.
SchoolPrecise statements
Definition: Notation for a triangle's sides, angles, and circles
In triangle ABC, side a=BC is opposite vertex A, side b=CA is opposite vertex B, and side c=AB is opposite vertex C. Let R be the radius of the circumscribed circle (through all three vertices), r the radius of the inscribed circle (tangent to all three sides), and p=2a+b+c the semiperimeter.
c2=a2+b2−2abcosC
This is the law of cosines: c2=a2+b2−2abcosC. Here C is the angle at vertex C, opposite side c. When C=90°, cosC=0 and the formula reduces exactly to the Pythagorean theorem c2=a2+b2 — the law of cosines is a generalization that works for any angle, not just right angles.
A right triangle with a square on each side labelled a squared, b squared and c squared; a note shows the numeric equality a squared plus b squared equals c squared.
The special case C=90∘ of the law of cosines: the correction term −2abcosC vanishes and c2=a2+b2 becomes the Pythagorean theorem, drawn as squares on the three sides of a right triangle. The slider changes the legs with c fixed; for other angles C the term −2abcosC corrects the gap.
sinAa=sinBb=sinCc=2R
This is the law of sines: sinAa=sinBb=sinCc=2R. It says the ratio of a side to the sine of its opposite angle is the same for all three sides, and that common value is exactly the diameter 2R of the circumscribed circle — a single number that captures the overall scale of the triangle.
In any triangle ABC with sides a,b,c opposite A,B,C, c2=a2+b2−2abcosC.
Why is it true?
Placing the triangle in coordinates with the known angle at the origin turns the unknown side into a distance formula, and expanding that distance formula automatically produces the extra cosine term beyond the Pythagorean sum.
Proof
Place vertex C at the origin, vertex A at (b,0) along the positive x-axis (since CA=b), and vertex B at (acosC,asinC) — this is the point at distance a from C (since CB=a) making angle C with the segment CA.
The side c=AB is the distance between A=(b,0) and B=(acosC,asinC), so c2=(b−acosC)2+(asinC)2.
Expanding the square: c2=b2−2abcosC+a2cos2C+a2sin2C.
Since cos2C+sin2C=1, the last two terms combine to a2, leaving c2=a2+b2−2abcosC, which is exactly c2=a2+b2−2abcosC. Repeating the same argument with a different vertex at the origin gives the analogous formulas for a2 and b2.
In any triangle ABC inscribed in a circle of radius R, sinAa=sinBb=sinCc=2R.
Why is it true?
Every inscribed angle subtending the same arc is equal, so replacing an angle by an equal angle at a cleverly chosen point turns the triangle into a right triangle inside the circle, where sine is just a ratio of a chord to the diameter.
Proof
Let O be the circumcenter and draw the diameter through B, meeting the circle again at a point B′. Since BB′ is a diameter, the inscribed angle ∠BCB′ subtends a semicircle, so ∠BCB′=90°.
The inscribed angles ∠BAC and ∠BB′C both subtend the same arc BC (or are supplementary if A and B′ lie on opposite arcs, in which case their sines are still equal since sin(180°−x)=sinx), so ∠BB′C=A or its supplement, and in either case sin(∠BB′C)=sinA.
In right triangle BCB′ (right-angled at C), the side BC=a is opposite ∠BB′C, and the hypotenuse BB′=2R is the diameter, so sin(∠BB′C)=2Ra.
Combining the last two steps, sinA=2Ra, i.e. sinAa=2R. Repeating the same construction with the diameter through A or through C gives sinBb=2R and sinCc=2R, so all three ratios equal 2R, proving sinAa=sinBb=sinCc=2R.
UndergraduateReal-World Applications and Worked Examples
These two laws are the backbone of triangulation, the technique of finding an unknown distance or position from known angles and a known side. Navigators and surveyors use the law of cosines to compute the distance between two ships or landmarks whose bearings and distances from a common point are known, and GPS and cell-tower positioning rely on the same triangle geometry to locate a receiver from signals with known angles or timing. Civil engineers use the law of sines to find unmeasurable lengths in trusses and roof frames, and land surveyors use Heron's formula to compute the area of an irregular plot from only its three (or more, by triangulating) side lengths, without needing to measure any angle directly.
Example: Distance between two ships
Two ships leave the same port. Ship 1 sails 30 km along one heading, and ship 2 sails 40 km along a heading that makes a 60° angle with ship 1's heading. Find the distance between the two ships.
Solution
The port and the two ships form a triangle where the two known sides (30 km and 40 km) meet at the port with a known included angle (60°) — exactly the setup for the law of cosines, c2=a2+b2−2abcosC, with a=30, b=40, C=60°, and c the unknown distance between the ships.
A triangular plot of land has sides 13 m, 14 m, and 15 m. Find its area.
Solution
Only the three side lengths are known and no angle is measured directly, so Heron's formula S=p(p−a)(p−b)(p−c) is the right tool, with semiperimeter p=213+14+15=21.
Computing the product inside the root: 21⋅8=168, 7⋅6=42, and 168⋅42=7056.
So S=7056=84. The plot has area 84 m².
A triangle has sides a=8, b=5, and included angle C=60°. Find the length of side c.
A triangle has sides a=5, b=12, c=13. Which of the following is true about angle C (opposite side c)?
A triangle has side a=10 opposite an angle A=30°. What is the diameter 2R of its circumscribed circle?
A surveyor measures the three sides of a triangular field as 9 m, 10 m, and 17 m, without measuring any angle. Which formula should be used to find the field's area?