Ekuation

Math

Triangle Calculator

The Triangle Calculator solves all triangle types from any valid combination of sides and angles. Enter three known values in SSS, SAS, ASA, AAS, or SSA form to instantly compute all sides, angles, area, perimeter, semiperimeter, inradius, circumradius, altitudes, and medians. The SSA ambiguous case is handled automatically, showing both solutions when they exist. Includes full step-by-step solutions using the Law of Sines, Law of Cosines, and Heron's formula.

Solve Mode

Select the combination of known values

Details: 2 sides + included angle

Known Values

Enter two sides and the angle between them

The angle between sides a and b

°
Triangle Solver Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

Right Triangle

Classic 3-4-5 right triangle using SSS mode.

Key values: a = 3 · b = 4 · c = 5

Roof Pitch

Calculate a roof triangle with two sides and a 35-degree pitch angle.

Key values: a = 6 · b = 8 · C = 35°

Equilateral Triangle

A perfect equilateral triangle with all sides equal to 10.

Key values: a = 10 · b = 10 · c = 10

Documentation

What Is a Triangle Solver?

A triangle solver calculates all unknown sides, angles, and derived properties of a triangle from a minimum set of known values. Any triangle is uniquely determined (up to congruence) by three independent measurements, provided at least one is a side. The five classic input combinations are:

  • SSS — three sides
  • SAS — two sides and the included angle
  • ASA — two angles and the included side
  • AAS — two angles and a non-included side
  • SSA — two sides and a non-included angle (ambiguous case)

From the solved triangle, this calculator also derives area, perimeter, semiperimeter, inradius, circumradius, altitudes, and medians — all the properties that appear in geometry courses, surveying, navigation, and engineering.


How to Use This Calculator

  1. Choose a solve mode (SSS, SAS, ASA, AAS, or SSA) depending on which values you know.
  2. Select the angle unit — degrees or radians.
  3. Enter the known values in the input fields that appear for your chosen mode.
  4. View the results: all six elements (three sides and three angles), area, perimeter, inradius, circumradius, altitudes, medians, and step-by-step solution formulas.

For the SSA (ambiguous) case, both valid triangles are displayed when they exist.


Key Formulas

Law of Cosines

c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C

Generalises the Pythagorean theorem to all triangles. Used in SSS mode (to find angles from three sides) and SAS mode (to find the third side from two sides and the included angle). When C=90C = 90^\circ, the formula reduces to c2=a2+b2c^2 = a^2 + b^2.

Law of Sines

asinA=bsinB=csinC=2R\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C} = 2R

Relates each side to the sine of its opposite angle. The common ratio equals the diameter of the circumscribed circle (2R2R). Used in ASA, AAS, and SSA modes.

Heron's Formula (Area from Three Sides)

A=s(sa)(sb)(sc),s=a+b+c2A = \sqrt{s(s-a)(s-b)(s-c)}, \quad s = \frac{a+b+c}{2}

Where ss is the semiperimeter. This formula computes the area directly from the three side lengths without needing any angle or height.

Area (Two Sides and Included Angle)

A=12absinCA = \frac{1}{2}ab\sin C

Where aa and bb are two sides and CC is the angle between them.

Inradius and Circumradius

r=As,R=abc4Ar = \frac{A}{s}, \qquad R = \frac{abc}{4A}

The inradius rr is the radius of the inscribed circle (tangent to all three sides). The circumradius RR is the radius of the circumscribed circle (passing through all three vertices).

Altitudes

ha=2Aa,hb=2Ab,hc=2Ach_a = \frac{2A}{a}, \quad h_b = \frac{2A}{b}, \quad h_c = \frac{2A}{c}

The altitude from vertex A is the perpendicular distance from A to side aa. Each altitude equals twice the area divided by its corresponding side.

Medians

ma=122b2+2c2a2m_a = \frac{1}{2}\sqrt{2b^2 + 2c^2 - a^2}

A median connects a vertex to the midpoint of the opposite side. The formula above gives the median from vertex A; analogous formulas apply for mbm_b and mcm_c.


Worked Examples

Example 1: Fencing a Triangular Plot (SSS)

A surveyor measures a triangular lot with sides a = 85 m, b = 120 m, and c = 95 m. Find all angles and the area.

  1. Angle A (Law of Cosines): cosA=b2+c2a22bc=14400+902572252×120×95=1620022800=0.7105\cos A = \frac{b^2+c^2-a^2}{2bc} = \frac{14400+9025-7225}{2 \times 120 \times 95} = \frac{16200}{22800} = 0.7105
  2. A=arccos(0.7105)44.73°A = \arccos(0.7105) \approx 44.73°
  3. Angle B: cosB=a2+c2b22ac=7225+9025144002×85×95=185016150=0.1146\cos B = \frac{a^2+c^2-b^2}{2ac} = \frac{7225+9025-14400}{2 \times 85 \times 95} = \frac{1850}{16150} = 0.1146
  4. B=arccos(0.1146)83.42°B = \arccos(0.1146) \approx 83.42°
  5. C=180°44.73°83.42°=51.85°C = 180° - 44.73° - 83.42° = 51.85°
  6. Area (Heron's formula): s=150s = 150, A=150×65×30×554,010.9 m2A = \sqrt{150 \times 65 \times 30 \times 55} \approx 4{,}010.9 \text{ m}^2

Practical note: The perimeter is 300 m of fencing, and the area is about 0.99 acres — useful for cost estimation and land valuation.

Example 2: Roof Truss Design (SAS)

An architect designs a roof truss with rafters a = 7 m and b = 10 m meeting at an apex angle of C = 45°. Find the span (third side) and the roof area.

  1. Span c (Law of Cosines): c=72+1022(7)(10)cos45°=49+10098.99=50.017.07 mc = \sqrt{7^2 + 10^2 - 2(7)(10)\cos 45°} = \sqrt{49 + 100 - 98.99} = \sqrt{50.01} \approx 7.07 \text{ m}
  2. Area: A=12(7)(10)sin45°=35×0.707124.75 m2A = \frac{1}{2}(7)(10)\sin 45° = 35 \times 0.7071 \approx 24.75 \text{ m}^2
  3. Angle A: A=arcsin ⁣(7sin45°7.07)44.5°A = \arcsin\!\left(\frac{7 \sin 45°}{7.07}\right) \approx 44.5°
  4. B=180°44.5°45°=90.5°B = 180° - 44.5° - 45° = 90.5°

Practical note: This is close to a right triangle at vertex B. The span of 7.07 m determines the wall-to-wall support distance.

Example 3: Navigation Bearing (AAS)

A ship sails 10 km on bearing 040°, then turns. The angle at the start is A = 70° and at the waypoint is B = 70°, with the known side a = 10 km (opposite to angle A). Find the return distance.

  1. C=180°70°70°=40°C = 180° - 70° - 70° = 40°
  2. Side c (Law of Sines): c=asinCsinA=10×sin40°sin70°=10×0.64280.93976.84 kmc = \frac{a \sin C}{\sin A} = \frac{10 \times \sin 40°}{\sin 70°} = \frac{10 \times 0.6428}{0.9397} \approx 6.84 \text{ km}
  3. Side b: b=asinBsinA=10×sin70°sin70°=10 kmb = \frac{a \sin B}{\sin A} = \frac{10 \times \sin 70°}{\sin 70°} = 10 \text{ km}

Practical note: Since A = B, the triangle is isosceles and sides a and b are equal. The direct return distance is about 6.84 km.

Example 4: SSA Ambiguous Case

Given a = 7, b = 10, A = 30°. How many valid triangles exist?

  1. sinB=bsinAa=10×0.57=0.7143\sin B = \frac{b \sin A}{a} = \frac{10 \times 0.5}{7} = 0.7143
  2. B1=arcsin(0.7143)45.58°B_1 = \arcsin(0.7143) \approx 45.58° and B2=180°45.58°=134.42°B_2 = 180° - 45.58° = 134.42°
  3. C1=180°30°45.58°=104.42°C_1 = 180° - 30° - 45.58° = 104.42° (valid, > 0)
  4. C2=180°30°134.42°=15.58°C_2 = 180° - 30° - 134.42° = 15.58° (valid, > 0)
  5. Two valid triangles exist. Triangle 1: B ≈ 45.58°, C ≈ 104.42°. Triangle 2: B ≈ 134.42°, C ≈ 15.58°.

Practical note: The SSA ambiguous case arises when angle A is acute and side a (opposite A) is shorter than side b. Always check the supplementary angle to determine if a second solution exists.


Solve Mode Reference

ModeKnown ValuesPrimary FormulaSolutions
SSS3 sidesLaw of Cosines (inverse)Exactly 1
SAS2 sides + included angleLaw of CosinesExactly 1
ASA2 angles + included sideLaw of SinesExactly 1
AAS2 angles + non-included sideLaw of SinesExactly 1
SSA2 sides + non-included angleLaw of Sines0, 1, or 2

Common Mistakes to Avoid

MistakeCorrection
Using degrees in a formula that expects radiansAlways check your calculator or programming language's trig functions. Most expect radians. Multiply degrees by π/180 to convert.
Ignoring the triangle inequalityThe sum of any two sides must exceed the third: a + b > c, a + c > b, b + c > a. If this fails, no valid triangle exists.
Forgetting the SSA ambiguous caseWhen given two sides and a non-included angle, always check the supplementary angle (180° − B) to see if a second valid triangle exists.
Assuming angles must be integersTriangle angles are rarely whole numbers. Carry sufficient decimal precision throughout your calculation to avoid cumulative rounding errors.
Using the wrong side–angle pairing in the Law of SinesEach side pairs with its opposite angle: side a is opposite angle A, side b is opposite angle B, side c is opposite angle C.

Frequently Asked Questions

What is the difference between the Law of Sines and the Law of Cosines?

The Law of Cosines relates three sides to one angle: c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C. Use it when you know SSS (three sides) or SAS (two sides and the included angle). The Law of Sines relates each side to its opposite angle: a/sinA=b/sinBa/\sin A = b/\sin B. Use it for ASA, AAS, and SSA problems. For SSS and SAS, the Law of Cosines is more numerically stable.

What is the SSA ambiguous case?

When given two sides and the angle opposite the first side (SSA), the Law of Sines may yield sinB1\sin B \leq 1 with two possible values of B. If both yield a positive third angle C, two distinct triangles satisfy the given data. If sinB>1\sin B > 1, no triangle exists. If sinB=1\sin B = 1, exactly one (right) triangle exists.

How do I find the area of a triangle without knowing the height?

Use Heron's formula if you know all three sides, or 12absinC\frac{1}{2}ab\sin C if you know two sides and the included angle. Both methods bypass the need for a perpendicular height measurement.

What are the inradius and circumradius?

The inradius (rr) is the radius of the largest circle that fits inside the triangle, tangent to all three sides. The circumradius (RR) is the radius of the smallest circle that passes through all three vertices. For an equilateral triangle with side aa, r=a23r = \frac{a}{2\sqrt{3}} and R=a3R = \frac{a}{\sqrt{3}}.

Can three angles alone determine a triangle?

No. Three angles define a family of similar triangles (same shape, any size). You need at least one side to pin down the scale. This is why all five solve modes require at least one side measurement.

How accurate is this calculator?

The calculator uses IEEE 754 double-precision floating-point arithmetic (about 15–16 significant digits). Results are accurate to at least 4 decimal places for typical inputs. Extreme cases (very flat or very large triangles) may have slightly reduced precision due to floating-point limitations.


Disclaimer

This calculator is provided for educational and convenience purposes only. While the formulas are based on standard mathematical definitions (sourced from Wolfram MathWorld and standard geometry textbooks), the results should not be used as the sole basis for critical engineering, construction, surveying, or navigation decisions. Always verify measurements independently and consult a qualified professional for applications where precision is essential.

Specialized Calculators

Choose from 4 specialized versions of this calculator, each optimized for specific use cases and calculation methods.

Related Calculators

6 Calculators

More Math calculators

Calculator Search

Search and find calculators