Triangle Calculator
Compute sides, angles, area, and perimeter for right triangles and general triangles.
What is a Triangle Calculator?
A triangle calculator takes the sides or angles you know and computes the remaining measurements using the fundamental laws of geometry. For a right triangle you need just two of the three sides — the Pythagorean theorem fills in the rest and trigonometry gives you the angles. For any triangle where all three side lengths are known (the SSS case), the Law of Cosines unlocks every angle, while Heron's formula gives the area without needing the height.
These tools are essential in construction, engineering, surveying, and everyday math. Whether you are checking if a corner is square using a 3-4-5 triangle, calculating the area of a triangular piece of land, or verifying a truss design, this calculator handles the arithmetic instantly.
Triangle Geometry Explained
Every triangle has three sides and three interior angles that always sum to exactly 180 degrees. The relationship between sides and angles is governed by a set of elegant laws — the Pythagorean theorem for right triangles, and the Law of Cosines and Law of Sines for the general case. Knowing just a few measurements is enough to determine the rest completely.
The Pythagorean Theorem: Right Triangle Basics
A right triangle contains exactly one 90-degree angle. Its sides follow the Pythagorean theorem:
where c is the hypotenuse (the side opposite the right angle — always the longest side) and a and b are the two legs. The classic 3-4-5 triangle is the simplest Pythagorean triple: 3² + 4² = 9 + 16 = 25 = 5². Builders use this to check for square corners — if you measure 3 feet along one wall, 4 feet along the other, and the diagonal is exactly 5 feet, the corner is a perfect right angle.
The angles in a right triangle come from basic trigonometry. If you know legs a and b, then Angle A = arctan(a/b) and Angle B = 90° − Angle A. With the hypotenuse known, you can alternatively use sin(A) = a/c or cos(A) = b/c.
Law of Cosines and Law of Sines
For a triangle that is not necessarily a right triangle, the Law of Cosines generalizes the Pythagorean theorem:
When angle C is 90°, cos(C) = 0 and the formula collapses to the Pythagorean theorem — confirming that it is a special case. When all three sides are known (the SSS configuration this calculator uses), we rearrange to find each angle: cos(C) = (a² + b² − c²) / (2ab). The Law of Sines — a/sin(A) = b/sin(B) = c/sin(C) — is useful when side-angle pairs are known, but for SSS the Law of Cosines is the more direct route.
Triangle Types: Acute, Right, and Obtuse
Triangles are classified both by their angles and by the relative lengths of their sides:
- Acute — all three angles are less than 90°.
- Right — exactly one angle equals 90°.
- Obtuse — exactly one angle is greater than 90°.
- Equilateral — all three sides equal; all angles are exactly 60°.
- Isosceles — two sides are equal; the two base angles are also equal.
- Scalene — all three sides differ; all three angles also differ.
For any triangle, you can test the angle type using the square of the longest side (c): if a² + b² > c², the triangle is acute; if a² + b² = c², it is right; if a² + b² < c², it is obtuse.
Static Example — The 3-4-5 Right Triangle
The 3-4-5 triangle is the most famous Pythagorean triple. Given legs a = 3 and b = 4:
- Hypotenuse: c = √(3² + 4²) = √(9 + 16) = √25 = 5
- Angle A (opposite a=3): arctan(3/4) ≈ 36.87°
- Angle B (opposite b=4): 90° − 36.87° ≈ 53.13°
- Angle C: 90°
- Area: (3 × 4) / 2 = 6 square units
- Perimeter: 3 + 4 + 5 = 12 units
All multiples of this triple are also valid right triangles: 6-8-10, 9-12-15, etc. Ancient Egyptian builders called ropes with 13 equally spaced knots (forming the 3-4-5 ratio) their "rope stretchers" — they used them to mark perfect right angles when laying foundations.
About These Parameters
- Legs (a, b) and Hypotenuse (c)
- In a right triangle, the two shorter sides meeting at the right angle are called "legs." The side opposite the right angle is the hypotenuse — always the longest of the three sides. Enter any two to compute the third.
- General Triangle Sides (a, b, c)
- In SSS mode, all three sides must satisfy the triangle inequality: the sum of any two sides must exceed the third. If this condition fails, no valid triangle exists with those measurements.
- Angles A, B, C
- Each angle is named for the vertex it sits at, and it is opposite the side of the same letter. For example, Angle A is opposite Side A. In any triangle, A + B + C = 180°.
- Area (Heron's Formula)
- When all three sides are known, area is computed as √(s(s−a)(s−b)(s−c)), where s = (a + b + c) / 2 is the semi-perimeter. For a right triangle the simpler formula Area = (a × b) / 2 also applies directly.
Frequently Asked Questions
What is the Pythagorean theorem?
The Pythagorean theorem states that in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs: a² + b² = c². It is named after the Greek mathematician Pythagoras (c. 570–495 BC), though evidence suggests it was known independently in Babylon and India centuries earlier. It is the foundation for calculating distances in 2D and 3D space, and it underpins much of trigonometry and Euclidean geometry.
How do you find the area of a triangle?
The most common formula is Area = ½ × base × height, but "height" must be the perpendicular height — not a side length. When only the three sides are known (no height), Heron's formula is the direct approach: compute the semi-perimeter s = (a + b + c) / 2, then Area = √(s(s−a)(s−b)(s−c)). For a right triangle specifically, the two legs are perpendicular to each other, so Area = ½ × leg_a × leg_b with no separate height calculation needed.
What makes a valid triangle?
For any three lengths to form a triangle, each side must be strictly less than the sum of the other two. This is called the triangle inequality: a + b > c, a + c > b, and b + c > a. Equivalently, the longest side must be shorter than the sum of the other two sides. If this condition fails — for example, sides 1, 2, 10 — the "triangle" degenerates and cannot close. The degenerate case where one side exactly equals the sum of the other two would produce a straight line (zero area), not a triangle.
What are Pythagorean triples?
Pythagorean triples are sets of three positive integers (a, b, c) that satisfy a² + b² = c² exactly — no decimals. The smallest and most famous is 3-4-5. Other primitive triples (where a, b, c share no common factor) include 5-12-13, 8-15-17, 7-24-25, and 9-40-41. Any multiple of a triple is also a triple: 3-4-5 scales to 6-8-10, 9-12-15, and so on. There are infinitely many Pythagorean triples, and they can be generated systematically with the formula a = m²−n², b = 2mn, c = m²+n² for positive integers m > n.
How do the 30-60-90 and 45-45-90 special right triangles work?
These two special right triangles have fixed side ratios that are worth memorizing. A 45-45-90 triangle is an isosceles right triangle: if the two legs each have length x, the hypotenuse is x√2 ≈ 1.414x. A 30-60-90 triangle has sides in the ratio 1 : √3 : 2 — if the shortest side (opposite the 30° angle) is x, then the other leg is x√3 ≈ 1.732x and the hypotenuse is 2x. These ratios arise naturally from cutting an equilateral triangle in half, and they appear constantly in geometry, trigonometry, and construction.