Skip to content
Popular Calculators
Browse Math calculators

Trigonometry Calculator

Solve any triangle by the law of sines or cosines — including the ambiguous SSA case, where two different triangles can fit the same measurements.

What do you want to work out?

About the Trigonometry Calculator

Right triangles are easy: SOHCAHTOA handles them. Every other triangle needs the two general laws, and this calculator is built around them.

The law of sines pairs each side with the angle opposite it. The law of cosines is Pythagoras with a correction term for the angle not being 90°. Between them they solve any triangle from any three measurements — provided at least one is a side.

But there is a case where "solve" is the wrong word, because two genuinely different triangles fit the same measurements. That is the ambiguous case, and it is the reason this page exists separately from the plain triangle calculator: rather than quietly picking one answer, it shows both and explains which is which.

How to Use the Trigonometry Calculator

Pick what you know:

SSS — three sides. SAS — two sides and the angle between them. ASA — two angles and the side between them. AAS — two angles and a side not between them. SSA — two sides and an angle not between them. This is the ambiguous one.

Sides and angles are matched by letter throughout: side a is opposite angle A, side b opposite B, side c opposite C. Getting that pairing right is most of the work.

The Two Laws

  Law of sines:
        a         b         c
      ───── = ───── = ─────
      sin A     sin B     sin C

  Law of cosines:
      a² = b² + c² − 2bc·cos A
      b² = a² + c² − 2ac·cos B
      c² = a² + b² − 2ab·cos C

  Rearranged for an angle:
      cos A = (b² + c² − a²) / 2bc

The law of cosines is the general Pythagoras. Set A to 90°, the cosine becomes zero, the last term disappears, and a² = b² + c² is what remains. Pythagoras is not a separate rule; it is this one at a right angle.

The law of sines needs a matched pair — a side and the angle facing it. Without one, you cannot start, which is why SSS and SAS must begin with the law of cosines.

A practical rule of thumb: cosines to open, sines to finish.

Which Law, Which Case

| You have | Start with | Ambiguous? | |----------|-----------|------------| | SSS | Law of cosines | No | | SAS | Law of cosines | No | | ASA | Angle sum, then sines | No | | AAS | Angle sum, then sines | No | | SSA | Law of sines | Yes — possibly two triangles | | AAA | — | No size at all |

Four of the five are clean. One is not.

The Ambiguous Case, Properly Explained

Suppose you know sides a and b, and angle A — which is opposite a, and therefore not between the two sides.

Picture building it. Draw angle A. Lay side b along one arm. Now take side a and swing it from the far end of b like a compass arm, looking for where it meets the other arm of the angle.

It might miss entirely. It might touch at exactly one point. It might cross at two.

Everything depends on comparing a with h = b·sin A, the perpendicular distance from the far end of b down to the other arm:

| Condition | Result | |-----------|--------| | a < h | The arm is too short. No triangle. | | a = h | It just touches. One right triangle. | | h < a < b | It crosses twice. Two triangles. | | a ≥ b | The second crossing falls behind the angle. One triangle. |

And if angle A is itself 90° or more, it must be the largest angle, so side a must be the longest side — otherwise there is no triangle at all, and there is never a second one.

Why two answers exist at all

Because arcsin returns only one of two possible angles. If sin B = 0.6, then B could be 36.87° or 143.13° — supplementary angles share a sine. A calculator returns the first. The second is just as valid, and whether it survives depends on whether A + B still leaves room for a third angle.

This is not a flaw in the arithmetic. Both triangles physically exist. If your problem has extra context — a diagram, or the knowledge that one angle is obtuse — use it to choose. If it does not, both are correct answers, and a question that expects only one is underspecified.

Step-by-Step Example

SSS. Sides 7, 8 and 9.

  cos A = (8² + 9² − 7²) / (2 × 8 × 9) = (64 + 81 − 49) / 144 = 0.66667
  A = 48.19°

  cos B = (7² + 9² − 8²) / (2 × 7 × 9) = 66/126 = 0.52381
  B = 58.41°

  C = 180 − 48.19 − 58.41 = 73.40°

SAS. Sides 6 and 9 with 60° between them.

  c² = 36 + 81 − 2(6)(9)cos60° = 117 − 54 = 63
  c = 7.937

  Area = ½ab·sin C = ½ × 6 × 9 × sin60° = 23.383

Note that ½ab·sin C gives the area with no height needed at all.

SSA, two solutions. a = 8, b = 10, A = 40°.

  h = 10 × sin40° = 6.428
  h < 8 < 10, so expect two triangles.

  sin B = 10 × sin40° / 8 = 0.8035
  B = 53.46°  or  B = 126.54°

  First:   C = 180 − 40 − 53.46 = 86.54°,  c = 12.42
  Second:  C = 180 − 40 − 126.54 = 13.46°, c = 2.90

Two triangles, same a, same b, same A — and third sides of 12.42 and 2.90. They are not close. Picking the wrong one is not a rounding error.

SSA, no solution. a = 3, b = 10, A = 40°.

  h = 6.428, and 3 < 6.428

The arm cannot reach. No triangle exists, and the calculator says so rather than producing a number.

Understanding Your Result

The solution line says how many triangles fit, and classifies the first.

The sides and angles give the full first solution, with each angle opposite its matching side.

The area and perimeter follow from it.

The second solution is the heart of the page. For four of the five cases it explains why there is no second answer. For SSA it either gives the complete second triangle, or names the angle that would have produced one and shows why it fails.

When Should You Use This Calculator?

Surveying and triangulation. Measure a baseline and two angles, and an unreachable point is fixed — the ASA case, and the foundation of mapping before satellites.

Navigation. Course, current and resulting track form a triangle, normally SAS.

Land measurement. Irregular plots split into triangles, each solved from whatever three measurements the tape can reach.

Engineering and trusses. Member lengths and joint angles.

Astronomy. Distances by parallax are a very thin triangle solved this way.

Physics. Resolving non-perpendicular forces needs the general laws, not SOHCAHTOA.

Coursework. The ambiguous case is a standard exam topic, and one where marks are lost for giving only one answer.

Common Mistakes

Giving only one answer in the ambiguous case. If both triangles exist, both are answers. This is the most commonly lost mark in the whole topic.

Using the law of sines without a matched pair. You need a side and the angle opposite it. Without one, start with the law of cosines.

Mismatching letters. Side a faces angle A. Pairing a with B produces a confident, wrong answer.

Applying Pythagoras to a non-right triangle. It does not hold. Use the law of cosines, which restores the missing term.

Forgetting the angle sum. The three must total 180°, and it is the cheapest check available.

Assuming arcsin gives the only angle. It gives the principal value. The supplement has the same sine.

Using AAA. Three angles fix the shape but not the size — a scale model has the same angles as the real thing.

Calculator in radians. As ever, check the mode first when an answer looks wrong.

Rounding mid-working. Carry full precision through and round once at the end. Angles feed into sines that feed into sides, and early rounding compounds fast.

Frequently Asked Questions

When do I use the law of sines and when the law of cosines?

The law of cosines when you have three sides, or two sides with the angle between them. The law of sines whenever you have a matched pair — a side and the angle opposite it — plus one more measurement. A rough guide: cosines to start a problem, sines to finish it.

What is the ambiguous case?

When you are given two sides and an angle that is not between them, there can be two genuinely different triangles that fit — one acute and one obtuse. It is a real property of the geometry, not a gap in the arithmetic, and this calculator shows both answers when both exist.

Why can two sides and an angle sometimes give no triangle at all?

Because the side opposite the given angle may be too short to reach the far side. Picture swinging it like a compass arm: if it cannot touch, no triangle closes. The calculator compares it with the perpendicular height and says so rather than returning an impossible answer.

How is the law of cosines related to Pythagoras?

It is the general version. At ninety degrees the cosine is zero, the correction term disappears, and a squared equals b squared plus c squared is what remains. Pythagoras is the special case rather than a separate rule.

Why does a triangle need three measurements?

Because three fix both shape and size, and at least one must be a side. Three angles give the shape only — a small triangle and a large one can have identical angles, so there is nothing to set the scale.

Last reviewed September 18, 2026 by the CalculatorPeak editorial team.