Triangle Side Calculator
Choose a method, enter the known values, and calculate the missing side instantly.
How to find a missing side of a triangle
Finding an unknown triangle side is one of the most common geometry tasks in school, engineering, construction, computer graphics, and everyday problem-solving. The key is choosing the correct formula based on the information you already know.
This calculator supports two proven methods:
- Pythagorean Theorem for right triangles
- Law of Cosines for non-right triangles when two sides and the included angle are known
Method 1: Right triangle (Pythagorean Theorem)
If your triangle has a 90° angle, use: a2 + b2 = c2, where c is the hypotenuse (the longest side).
Common rearrangements
- Missing hypotenuse: c = √(a2 + b2)
- Missing leg a: a = √(c2 - b2)
- Missing leg b: b = √(c2 - a2)
Important: the hypotenuse must always be greater than either leg. If not, the input values cannot form a valid right triangle.
Method 2: Any triangle (Law of Cosines)
For a triangle that is not necessarily right, if you know two sides and the angle between them, use:
z2 = x2 + y2 - 2xy cos(θ)
Then solve for the unknown side: z = √(x2 + y2 - 2xy cos(θ)).
Example calculations
Example A (right triangle)
Given a = 6 and b = 8: c = √(62 + 82) = √(36 + 64) = √100 = 10.
Example B (law of cosines)
Given sides x = 9, y = 12, and included angle θ = 60°: z = √(92 + 122 - 2(9)(12)cos60°) = √(81 + 144 - 108) = √117.
Tips for accurate results
- Use consistent units (all inches, all meters, etc.).
- For right triangles, mark the hypotenuse correctly before entering values.
- For law of cosines, ensure the angle is the included angle between the two known sides.
- Do not use 0 or negative values for side lengths.
Where this is useful
Missing side calculations are useful in roof pitch planning, ladder safety checks, navigation, land measurements, 3D modeling, robotics, and game development. Knowing how to switch between Pythagorean and cosine methods gives you a reliable toolkit for almost any triangle geometry task.
Quick FAQ
Can this calculator handle non-right triangles?
Yes. Choose the Law of Cosines option and provide two sides plus the included angle.
Why am I getting an error with right triangle inputs?
The most common issue is entering a hypotenuse that is not larger than the known leg.
Does this round values?
Yes. Results are displayed with up to six decimal places for readability.