Triangle Calculator
Solve any triangle from three sides or angles, or a right triangle from two values, with a diagram to scale, both answers in the ambiguous case, and the working.
Fill in any two values, with at least one length. Angle C is 90°.
Solved
c = 5A ≈ 36.87°B ≈ 53.13°Area = 6h = 2.4
- Perimeter
- 12
- Area
- 6
- Height to a
- 4
- Height to b
- 3
- Height to c
- 2.4
- Inradius
- 1
- Circumradius
- 2.5
- Type
- Right, scalene
Working
Type any three of a triangle's sides and angles, or any two values of a right triangle, and the calculator finds the rest: every side and angle, the perimeter and area, the three heights, medians and angle bisectors, and the inscribed and circumscribed radii. A diagram is drawn to scale and each law used is worked in your numbers.
When two sides and an angle not between them allow two different triangles, both are given, with the reason in words. Special triangles stay exact: a 30-60-90 triangle with a hypotenuse of 2 has legs 1 and √3.
How to use it
Right triangle fixes angle C at 90°, so c is the hypotenuse. Any two of the legs, the hypotenuse, the angles A and B, the area and the height to the hypotenuse solve it, as long as one is a length or an area.
Any triangle takes three of a, b, c, A, B and C, with side a opposite angle A. The case is named as it applies: SSS, SAS, ASA, AAS or SSA. Angles can be typed in degrees, in radians (π/6, 5pi/6 or 0.52) or as degrees, minutes and seconds (30° 15' 20"), and are shown in the same unit. Solved values appear in the fields left empty. Clear empties the fields for new values, and the switch under the results adds the medians and angle bisectors.
How it works
Three sides give each angle by the law of cosines. Two sides with the angle between them give the third side by the same law. Two angles give the third by subtracting from 180°, then the sides by the law of sines. The area is Heron's formula or ½ab sin C, whichever keeps it exact.
With two sides and an angle not between them (SSA), say a, b and A, the side a swings from the corner C and must reach the line that b leaves from A. The height h = b sin A is the shortest distance to that line. If a is shorter than h, there is no triangle; if a equals h, one right triangle; if a lies between h and b, a meets the line in two places, giving two triangles; if a is at least b, only one. Exact inputs are compared exactly, so a = h is caught without rounding.
The diagram puts the longest side along the bottom. A triangle with an angle under 0.001° would draw as a line, so its thinnest angle is widened and the diagram says it is not to scale.
Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C
Law of cosines: c² = a² + b² − 2ab cos C
Heron: area = √(s(s − a)(s − b)(s − c)), s = (a + b + c) ÷ 2
Pythagoras (C = 90°): c² = a² + b²
SSA: h = b sin A; a < h none, a = h one, h < a < b two, a ≥ b one
Inradius r = area ÷ s; circumradius R = a ÷ (2 sin A)
Examples
A hypotenuse from two legs
With Right triangle, side a = 5, side b = 12: the hypotenuse is 13, a 5-12-13 triangle, and angle A is ≈ 22.61986495°.
- Pythagoras: c² = a² + b² c = √(5² + 12²) = 13
- sin A = a ÷ c sin A = 5 ÷ 13 ≈ 0.3846153846, so A ≈ 22.61986495°
- The angles add up to 180° B ≈ 67.38013505°
Three sides (SSS)
With side a = 5, side b = 6, side c = 7, the area is exactly 6√6 ≈ 14.69693846, and the largest angle, C opposite the longest side, is ≈ 78.46304097°.
Two sides and the angle between (SAS)
With side a = 3, side b = 5, angle C = 120°, the law of cosines gives c = 7 exactly, since cos 120° = −½.
Two angles and a side (ASA)
With angle A = 30°, angle B = 60°, side c = 10, C is 90° and the law of sines gives a = 5 and b = 5√3 ≈ 8.660254038.
The ambiguous case: two triangles (SSA)
With angle A = 30°, side a = 6, side b = 10: a = 6 lies between the height h = 5 and b = 10, so it can swing to two positions: two triangles. Angle B is ≈ 56.44269024° in the first and ≈ 123.5573098° in the second, with c = ≈ 11.97687883 or ≈ 5.343629247.
- Height from the corner between the given sides h = b × sin A = 10 × sin 30° = 5
- Law of sines: sin B = b × sin A ÷ a sin B ≈ 0.8333333333, so B ≈ 56.44269024°
- The angles add up to 180° C ≈ 93.55730976°
- Law of sines: c = a × sin C ÷ sin A c ≈ 11.97687883
Frequently asked questions
See also
- Area Calculator — for a triangle's area from its base and height, and for other shapes and plots.
- Unit Circle — for the exact sines and cosines behind special triangles.