StatGardenREF. DESK
Calculators/Maths/Trigonometry: solve a triangle
Maths

Trigonometry: solve a triangle calculator

Sine and cosine rules from two sides and the included angle.

What this calculator does

Given two sides and the angle between them, a triangle is completely determined. The cosine rule finds the third side, the sine rule then gives the remaining angles, and the area follows directly from the two sides and the included angle without needing the height at all.

This is the side-angle-side case, and it is the one most surveying and construction problems reduce to. It is also the well-behaved case: unlike side-side-angle, it always produces exactly one triangle, with no ambiguity to resolve.

The formula

Formulac² = a² + b² − 2ab·cos C; Area = ½ab·sin C; cos A = (b² + c² − a²) / 2bc

The cosine rule generalises Pythagoras. When the included angle is 90°, its cosine is zero and the correction term vanishes, leaving c² = a² + b². For any other angle the term adjusts for how much the triangle leans. The area formula ½ab·sin C works because b·sin C is exactly the perpendicular height onto side a.

TermMeaning
a, bThe two known sides.
CThe angle between them: the included angle.
cThe side opposite angle C.
Cosine rulec² = a² + b² − 2ab·cos C.
Sine rulesin A ÷ a = sin B ÷ b = sin C ÷ c.

The inputs explained

FieldWhat to enter
Side aThe first known side.
Side bThe second known side.
Angle between them (C) (°)The angle between the two sides, in degrees. It must be under 180° for a valid triangle.

When to use it

Surveying and land measurement

Measuring two distances from a fixed point and the angle between them gives the distance across, without needing to traverse it. This is the basis of triangulation.

Setting out on a building site

Two known lengths and an angle determine the third length exactly, which is how a diagonal brace or a roof member is sized.

Checking a right angle

Set the angle to 90° and the cosine rule collapses to Pythagoras. It is a useful demonstration that the two are the same result.

Finding area without the height

The half-times-two-sides-times-sine formula avoids measuring a perpendicular, which is often the hardest measurement to take in the field.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the included angle changes the triangle

Two fixed sides of 8 and 6, with the angle between them varying.

Sides 8 and 6
Included angleThird side cAreaPerimeter
30°4.10612.00018.106
60°7.21120.78521.211
90°10.00024.00024.000
120°12.16620.78526.166
150°13.53312.00027.533
170°13.9484.16827.948
At 90° the third side is exactly 10, the 6-8-10 right triangle. Area peaks at 90° because sin C is largest there, then falls away as the triangle flattens.

Varying one side at a fixed 60° angle

One side held at 6 with a 60° included angle, as the other side grows.

Side b = 6, angle 60°
Side aThird side cAngle AAngle BArea
35.19630.00°90.00°7.794
66.00060.00°60.00°15.588
87.21173.90°46.10°20.785
1210.39290.00°30.00°31.177
2017.776103.00°17.00°51.962
4037.363112.01°7.99°103.923
When a = b = 6 the triangle is equilateral, since a 60° angle between two equal sides forces the other two angles to 60° as well.

Questions

When do I use the cosine rule rather than the sine rule?

Use the cosine rule when you know two sides and the angle between them, or all three sides. Use the sine rule when you have an angle and its opposite side, plus one other measurement.

Is the cosine rule related to Pythagoras?

It generalises it. At 90° the cosine is zero and the −2ab·cos C term disappears, leaving c² = a² + b². For acute angles the term is negative and c is shorter; for obtuse angles it is positive and c is longer.

What is the ambiguous case?

It arises with side-side-angle, where two different triangles can satisfy the same measurements. Side-angle-side, which this calculator handles, is never ambiguous: the triangle is uniquely determined.

Can I find the area without the angle?

Yes, if you know all three sides: Heron’s formula does it, and the triangle-from-three-sides calculator applies it.

Why does the area peak at 90°?

Because area is ½ab·sin C and the sine function peaks at 90°. Beyond that the triangle flattens and the perpendicular height falls, even though the sides are unchanged.

For all three sides known, see triangle from three sides. For right angles specifically, use the right triangle calculator.