Triangles seem simple until you’re given two sides and one angle and asked to find everything else.
However, in a Triangle Calculator context, that task becomes harder, since the idea isn’t solved by the Pythagorean theorem alone.
Most triangles you’ll actually run into aren’t right triangles. Moreover, Land surveys, construction angles, and physics vectors—none of them politely arrange themselves into 90-degree corners. Therefore, you need a bigger toolkit than the one from 8th grade for Triangle Calculator.
Here’s the actual toolkit.
Start with what you’re given.
A triangle has 6 measurements: 3 sides and 3 angles. You never need all 6 to solve the rest. You need 3, and which 3 you have determines which formula you reach for.
The four situations that come up over and over:
SSS: You know all 3 sides; you need the angles.
SAS: you know 2 sides and the angle between them.
ASA or AAS: you know 2 angles and a side.
Right triangle: you know it has a 90-degree angle, plus one more piece.
Each one needs a different formula. Grab the wrong one, and you’ll either get an error or a number that quietly makes no sense.
Right triangles first, because they’re the easy case.
If you’ve got a right angle, the Pythagorean theorem handles the sides:
a² + b² = c²
c is always the hypotenuse, the side across from the right angle. Say a leg is 6, and the hypotenuse is 10. Then b² = 100 − 36 = 64, so b = 8. That’s your classic 6-8-10 triangle, a scaled-up version of 3-4-5.
For angles in a right triangle, trig functions do the work:
sin(θ) = opposite / hypotenuse
cos(θ) = adjacent / hypotenuse
tan(θ) = opposite / adjacent
Same 6-8-10 triangle: the angle opposite the side of length 6 has sin(θ) = 6/10 = 0.6, so θ ≈ 36.87°. The other non-right angle is 90 − 36.87 = 53.13°.
The area for a right triangle is the simplest version of the area formula too:
Area = (1/2) × base × height
Base and height are just the two legs, since they’re already perpendicular. 6 × 8 / 2 = 24 square units.
Once there’s no right angle, you need the Law of Cosines
This is the formula that quietly does more work than any other in triangle math. It’s the Pythagorean theorem’s generalization, built to handle any angle, not just 90 degrees.
c² = a² + b² − 2ab × cos(C)
C is the angle opposite side c. Rearrange it, and you can solve for the angle instead if you know all 3 sides:
cos(C) = (a² + b² − c²) / (2ab)
Say you’ve got a triangle with sides 7, 9, and 12. Find the angle opposite the side of length 12:
cos(C) = (7² + 9² − 12²) / (2 × 7 × 9) = (49 + 81 − 144) / 126 = −14/126 ≈ −0.1111
C = arccos(−0.1111) ≈ 96.38°
Notice the negative cosine. That’s not an error; it means the angle is obtuse, over 90 degrees. If you’d forgotten to check the sign and just eyeballed it, you’d have guessed wrong.
The Law of Sines, for when you’ve got angles and a side
This one’s cleaner:
a/sin(A) = b/sin(B) = c/sin(C)
Every side and its opposite angle share the same ratio. Know one full pair (a side and its opposite angle) plus one more piece, and you can solve the rest.
Say angle A = 40°, angle B = 75°, and side a = 10. First, angle C = 180 − 40 − 75 = 65°, since angles in a triangle always sum to 180.
Then b = a × sin(B) / sin(A) = 10 × sin(75°) / sin(40°) = 10 × 0.9659 / 0.6428 ≈ 15.03
And c = 10 × sin(65°) / sin(40°) = 10 × 0.9063 / 0.6428 ≈ 14.10
Three pieces of information turned into a fully solved triangle.
The ambiguous case that trips people up
The Law of Sines has a trap. Given two sides and an angle not between them (SSA), there can be two valid triangles, one valid triangle, or none at all. This is genuinely called “the ambiguous case,” and it’s not a rare edge condition; it shows up constantly in navigation and surveying problems.
Say side a = 8, side b = 10, angle A = 35°. Using the Law of Sines to find angle B:
sin(B) = b × sin(A) / a = 10 × sin(35°) / 8 = 10 × 0.5736 / 8 ≈ 0.7170
B ≈ 45.8° or B ≈ 134.2° (since sine is positive in both the first and second quadrants)
Both are mathematically valid answers. Only the context of your actual problem, or a diagram, tells you which one’s real. A calculator that spits out one answer without flagging this is hiding information from you.
Area, beyond the base-times-height version
If you don’t have a clean base and height, but you do have two sides and the angle between them, use this instead:
Area = (1/2) × a × b × sin(C)
Two sides of 8 and 11, with a 50-degree angle between them: Area = 0.5 × 8 × 11 × sin(50°) = 44 × 0.766 ≈ 33.7 square units.
And if you’ve only got 3 sides and nothing else, Heron’s formula gets you there without needing any angle at all:
s = (a + b + c) / 2
Area = √(s(s−a)(s−b)(s−c))
s is the semi-perimeter, half the total perimeter. Sides 7, 9, 12:
s = (7 + 9 + 12) / 2 = 14
Area = √(14 × 7 × 5 × 2) = √980 ≈ 31.3 square units
Heron’s formula looks intimidating the first time you see it. It’s just multiplication and a square root once you’ve got s.
Checking your work without a calculator
Two sanity checks catch most mistakes.
Angles have to sum to exactly 180°. If your three computed angles add up to 179.4° or 181.2°, something upstream got rounded wrong or a formula got misapplied.
The triangle inequality has to hold: any two sides added together must be greater than the third. Sides of 4, 5, and 10 can’t form a triangle at all, since 4 + 5 = 9 is less than 10. If your calculator accepts those three numbers and gives you an answer, it’s giving you a number for a shape that doesn’t physically close.
Which formula to actually reach for
Right angle present → Pythagorean theorem and basic trig ratios.
All 3 sides, no angles → Law of Cosines for angles, Heron’s formula for area.
2 sides plus the included angle → Law of Cosines for the third side, then the (1/2)ab sin(C) formula for area.
2 angles plus any side → Law of Sines for everything else.
2 sides plus a non-included angle → Law of Sines, but check for the ambiguous case before trusting a single answer.
Once you know which case you’re in, the formula picks itself. The hard part was never the math. It was figuring out which of the 6 measurements you’re actually holding.
Want me to build this out as an interactive triangle calculator, where you input any 3 known values, and it solves the rest and flags the ambiguous case when it shows up?