Trigonometry

Triangle Calculator

This triangle calculator is a full triangle solver: enter three known parts (SSS, SAS, ASA, AAS or SSA) and it finds every missing side and angle with the law of cosines c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C or the law of sines asin⁡A=bsin⁡B\frac{a}{\sin A} = \frac{b}{\sin B}, plus the area, perimeter, heights and medians.

Try

Side a is opposite angle A, b is opposite B and c is opposite C. For a right triangle where you know only two sides, use the Pythagorean theorem calculator.

Angle unit

Radians accept multiples of π such as pi/3 or 2pi/5.

Result

Solved triangle: a = 5, b = 6, c = 7; A = 44.4153086°, B = 57.12165044°, C = 78.46304097°

Solved triangle

a = 5, b = 6, c = 7; A = 44.4153086°, B = 57.12165044°, C = 78.46304097°

Scalene acute triangle

Area
14.69693846
Perimeter
18
Heights h_a, h_b, h_cPerpendicular distance from each vertex to the opposite side
5.878775383, 4.898979486, 4.199125273
Medians m_a, m_b, m_cFrom each vertex to the midpoint of the opposite side
6.020797289, 5.291502622, 4.272001873
Inradius rr = area / s
1.632993162
Circumradius RR = a / (2 sin A)
3.572172542
Type
Scalene, acute
Semiperimeter s
9

The triangle has sides 5, 6 and 7 and angles 44.4153086°, 57.12165044° and 78.46304097°. It is scalene and acute, with area 14.69693846 and perimeter 18.

Angles are in degrees. Values are rounded to 10 significant digits.

The solved triangle
ABCa = 5b = 6c = 7
Sides and angles
PartValueSource
Side a5Given
Side b6Given
Side c7Given
Angle A44.4153086°Calculated
Angle B57.12165044°Calculated
Angle C78.46304097°Calculated
Step-by-step working (6 steps)
  1. Known: SSS

    Given a = 5, b = 6, c = 7.

  2. Law of cosines for angle A

    cos⁡A=b2+c2−a22bc=62+72−522⋅6⋅7=0.7142857143⇒A=44.4153086∘\cos A = \frac{b^2 + c^2 - a^2}{2bc} = \frac{6^2 + 7^2 - 5^2}{2 \cdot 6 \cdot 7} = 0.7142857143 \;\Rightarrow\; A = 44.4153086^{\circ}
  3. Law of cosines for angle B

    cos⁡B=a2+c2−b22ac=52+72−622⋅5⋅7=0.5428571429⇒B=57.12165044∘\cos B = \frac{a^2 + c^2 - b^2}{2ac} = \frac{5^2 + 7^2 - 6^2}{2 \cdot 5 \cdot 7} = 0.5428571429 \;\Rightarrow\; B = 57.12165044^{\circ}
  4. Angle sum for C

    The angles of a triangle add up to 180°.

    C=180∘−44.4153086∘−57.12165044∘=78.46304097∘C = 180^{\circ} - 44.4153086^{\circ} - 57.12165044^{\circ} = 78.46304097^{\circ}
  5. Area with Heron’s formula

    The semiperimeter is s = (a + b + c)/2 = 9.

    K=s(s−a)(s−b)(s−c)=14.69693846K = \sqrt{s(s-a)(s-b)(s-c)} = 14.69693846
  6. Check with ½ab sin C

    K=12absin⁡C=12⋅5⋅6sin⁡78.46304097∘=14.69693846K = \tfrac{1}{2}ab\sin C = \tfrac{1}{2} \cdot 5 \cdot 6 \sin 78.46304097^{\circ} = 14.69693846
By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Pick the case that matches what you know. SSS is three sides; SAS is two sides and the angle between them; ASA and AAS are two angles and one side; SSA is two sides and an angle that is not between them.
  2. Label the triangle so that side a is opposite angle A, b opposite B and c opposite C, then enter the values. Sides accept decimals and fractions such as 7/2.
  3. Choose degrees or radians for the angles. In radians you can type multiples of π, such as pi/3.
  4. Sides must satisfy the triangle inequality, and two known angles must add up to less than 180°. If they do not, the calculator says which rule failed.
  5. Read the result: every side and angle, the triangle type, area, perimeter, heights, medians, inradius and circumradius. Open the steps to see each law-of-cosines or law-of-sines substitution.
  6. For SSA, check the number of triangles: the data can fit none, one or two, and every solution is listed with its own diagram data.

Formulas

Law of cosines

c2=a2+b2−2abcos⁡C,cos⁡C=a2+b2−c22abc^2 = a^2 + b^2 - 2ab\cos C, \qquad \cos C = \frac{a^2 + b^2 - c^2}{2ab}

Plain-text formula: c^2 = a^2 + b^2 − 2ab cos C, cos C = (a^2 + b^2 − c^2)/(2ab)

a, b, c
the side lengths
C
the angle opposite side c, between sides a and b

Use it for SSS (to find an angle from three sides) and SAS (to find the third side). It reduces to the Pythagorean theorem when C = 90°, because cos 90° = 0.

Law of sines

asin⁡A=bsin⁡B=csin⁡C=2R\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} = 2R

Plain-text formula: a/(sin A) = b/(sin B) = c/(sin C) = 2R

Use it when you know a side and its opposite angle (ASA, AAS, SSA). The common ratio equals the diameter of the circumscribed circle.

Area of a triangle

K=12bh=12absin⁡C=s(s−a)(s−b)(s−c),s=a+b+c2K = \tfrac{1}{2}bh = \tfrac{1}{2}ab\sin C = \sqrt{s(s-a)(s-b)(s-c)}, \quad s = \frac{a+b+c}{2}

Plain-text formula: K = (1/2)bh = (1/2)ab sin C = √(s(s − a)(s − b)(s − c)), s = (a + b + c)/2

Half the base times the height; or half of two sides times the sine of the angle between them; or Heron’s formula from the three sides. The calculator uses Heron and checks it with the sine form.

Heights, medians and radii

ha=2Ka,ma=122b2+2c2−a2,r=Ks,R=a2sin⁡Ah_a = \frac{2K}{a}, \quad m_a = \tfrac{1}{2}\sqrt{2b^2 + 2c^2 - a^2}, \quad r = \frac{K}{s}, \quad R = \frac{a}{2\sin A}

Plain-text formula: h_a = (2K)/a, m_a = (1/2)√(2b^2 + 2c^2 − a^2), r = K/s, R = a/(2 sin A)

Each height runs from a vertex perpendicular to the opposite side; each median runs to the midpoint of the opposite side. r is the radius of the inscribed circle and R of the circumscribed circle.

Reading the result

The result lists all six parts. The angles always add up to 180° (π radians), and the longest side is always opposite the largest angle, which is a quick check on your labeling.

The type combines sides (equilateral, isosceles or scalene) and angles (acute, right or obtuse). If the triangle has a 90° angle you can also use the Pythagorean theorem calculator, which finds a missing side from the other two and adds SOH-CAH-TOA steps.

Results are rounded to 10 significant digits. When you type rounded inputs, round the answers to the same precision; a side measured to 0.1 cm does not give an angle to a millionth of a degree.

How to solve a triangle

To solve a triangle means to find all three sides and all three angles. You need three of the six parts, and at least one must be a side, because three angles fix only the shape, not the size. Which law to use depends on where the known angle sits.

Three sides (SSS). Find the largest angle first with the law of cosines, then a second angle the same way, then subtract from 180°. The worked example below solves sides 5, 6 and 7.

Two sides and the angle between them (SAS). Find the third side with the law of cosines, then an angle. For a = 8, b = 11 and C = 37°: c2=82+112−2⋅8⋅11cos⁡37∘≈44.44015c^2 = 8^2 + 11^2 - 2 \cdot 8 \cdot 11 \cos 37^{\circ} \approx 44.44015, so c ≈ 6.666344593. Then A ≈ 46.23748662° and B = 180° − 37° − A ≈ 96.76251338°.

Two angles and a side (ASA or AAS). Subtract the two angles from 180° to get the third, then find each missing side with the law of sines. For A = 50°, B = 65° and c = 12: C = 65°, and a=12sin⁡50∘sin⁡65∘≈10.14283828a = \frac{12 \sin 50^{\circ}}{\sin 65^{\circ}} \approx 10.14283828.

Two sides and an angle not between them (SSA). Use the law of sines for the second angle, then check whether its supplement also fits; see the ambiguous case below.

Which law to use for each case
CaseWhat you knowFirst stepNumber of triangles
SSSThree sidesLaw of cosines for an angleOne, if the triangle inequality holds
SASTwo sides and the included angleLaw of cosines for the third sideOne
ASATwo angles and the side between themAngle sum, then law of sinesOne, if the angles total under 180°
AASTwo angles and a side not between themAngle sum, then law of sinesOne, if the angles total under 180°
SSATwo sides and an angle not between themLaw of sines for a second angleNone, one or two
AAAThree angles onlyNot solvableInfinitely many similar triangles

The SSA ambiguous case

Knowing two sides and a non-included angle does not always fix the triangle. Picture side b and angle A fixed, and side a swinging from C like a compass: it can miss the base, touch it once or cross it twice. The deciding length is the height h=bsin⁡Ah = b\sin A.

For a = 7, b = 10 and A = 40°, the height is 10 sin 40° ≈ 6.427876097. Side a = 7 is longer than the height but shorter than b, so it meets the base twice: B ≈ 66.67417652° with c ≈ 10.4321603, or B ≈ 113.3258235° with c ≈ 4.888728558. Both are valid, and the calculator lists both.

With a = 7, b = 10 and A = 40°, side a reaches the base at B₁ (acute B) and at B₂ (obtuse B). The dashed line is the height h = b sin A.
How many triangles fit SSA data (angle A acute)
Side a compared with h = b sin A and bTrianglesExample with b = 10, A = 40°
a < hNonea = 3
a = hOne right trianglea ≈ 6.427876097
h < a < bTwoa = 7
a ≥ bOnea = 12

Triangle area, height and perimeter

The calculator returns the area whichever case you start from. If you know a base and its height, the area is simply half their product, K=12bhK = \tfrac{1}{2}bh. With two sides and the angle between them, use K=12absin⁡CK = \tfrac{1}{2}ab\sin C. With three sides, use Heron’s formula.

To find the height to a side, divide twice the area by that side: ha=2K/ah_a = 2K/a. For sides 5, 6 and 7 the area is 6√6 ≈ 14.69693846, so the height to side 7 is 2 × 14.69693846 / 7 ≈ 4.199125273. The perimeter is a + b + c, and half of it is the semiperimeter s used in Heron’s formula and in the inradius r = K/s.

Worked example

Solve the triangle with sides 5, 6 and 7

Find the angles, area, heights and medians of a triangle with a = 5, b = 6 and c = 7.

  1. Law of cosines for A: cos⁡A=62+72−522⋅6⋅7=6084≈0.7142857\cos A = \frac{6^2 + 7^2 - 5^2}{2 \cdot 6 \cdot 7} = \frac{60}{84} \approx 0.7142857, so A ≈ 44.4153086°.
  2. Law of cosines for B: cos⁡B=52+72−622⋅5⋅7=3870≈0.5428571\cos B = \frac{5^2 + 7^2 - 6^2}{2 \cdot 5 \cdot 7} = \frac{38}{70} \approx 0.5428571, so B ≈ 57.1216504°.
  3. Angle sum: C = 180° − 44.4153086° − 57.1216504° ≈ 78.4630410°.
  4. Heron: s = 9, so K=9⋅4⋅3⋅2=216=66≈14.69693846K = \sqrt{9 \cdot 4 \cdot 3 \cdot 2} = \sqrt{216} = 6\sqrt{6} \approx 14.69693846.
  5. Height to side c: hc=2K/c=126/7≈4.199125273h_c = 2K/c = 12\sqrt{6}/7 \approx 4.199125273. Median to side c: mc=122⋅52+2⋅62−72=1273≈4.272001873m_c = \tfrac{1}{2}\sqrt{2 \cdot 5^2 + 2 \cdot 6^2 - 7^2} = \tfrac{1}{2}\sqrt{73} \approx 4.272001873.

Answer: A ≈ 44.42°, B ≈ 57.12°, C ≈ 78.46°, area 6√6 ≈ 14.69693846 and perimeter 18. The triangle is scalene and acute.

Frequently asked questions

How do I find the missing side of a triangle?

With two sides and the angle between them, use the law of cosines: c² = a² + b² − 2ab cos C. With a side, its opposite angle and one more angle, use the law of sines: b = a sin B / sin A. In a right triangle, the Pythagorean theorem a² + b² = c² is enough.

How do I find the third angle of a triangle?

Subtract the two known angles from 180°. For angles of 50° and 65°, the third is 180° − 50° − 65° = 65°. If you know three sides instead, use the law of cosines for one angle at a time.

Why does SSA sometimes give two triangles?

Because sin B = sin(180° − B). If side a can swing to meet the base at two points, both an acute and an obtuse angle B fit. For a = 7, b = 10 and A = 40°, B is about 66.7° or 113.3°.

What is the triangle inequality?

Each side must be shorter than the sum of the other two. Sides 2, 3 and 6 fail because 2 + 3 < 6, and 2, 3 and 5 would only give a flat line.

How do I find the area or height of a triangle from three sides?

Choose SSS and enter the three sides. The result gives the area by Heron’s formula and all three heights, h = 2 × area ÷ base. For sides 5, 6 and 7 the area is about 14.69693846 and the height to side 7 is about 4.199125273.

Is there a triangle calculator app?

You do not need one. This page works in any phone browser, and you can add ScientifiCalc to your home screen so it opens with one tap like an app.

Can I enter angles in radians?

Yes. Switch the angle unit to radians and type a number or a multiple of π, such as pi/3. The results show each angle in radians with degrees in brackets. To convert one angle on its own, multiply by 180/π or use the DMS to decimal degrees converter.

Trigonometry Calculator

All six trig functions of an angle, or the angle from a ratio, with exact values, quadrant and steps.

Trigonometry

Polar to Rectangular Calculator

Polar ↔ rectangular (Cartesian) conversion with steps, quadrant reasoning, exact values and exponential form.

Algebra & Equations

Scientific Calculator

Type or tap expressions with exact fractions, memory, variables, constants and complex mode.

Tools

Unit Converter

Convert between units in 40 categories with exact factors, formulas and tables.

Tools

Learn more: For the sine and cosine ratios behind these results, read how to use sin, cos and tan.

Sources and further reading

  1. Algebra and Trigonometry 2e, Section 10.1: Non-right Triangles: Law of Sines; Section 10.2: Law of Cosines (opens in a new tab), OpenStax, Rice University
  2. NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles (opens in a new tab), National Institute of Standards and Technology
  3. Triangle Median (opens in a new tab), Wolfram MathWorld

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?