NepSamaya logo

Triangle Calculator

Solve any triangle: input 3 values (sides/angles) and get missing sides, angles, area, perimeter, and height. Supports right triangles and Pythagorean theorem.

Key Features

  • Solve triangles from: SSS, SAS, ASA, AAS, SSA (ambiguous case supported)
  • Right triangle mode with Pythagorean theorem shortcut
  • All outputs: 3 sides, 3 angles, area, perimeter, 3 heights
  • Circumradius and inradius calculations
  • Triangle type classification: Acute, Right, Obtuse
  • Degrees or radians input/output toggle
  • Degrees/Minutes/Seconds (DMS) input support
  • Visual triangle diagram (scaled representation)
  • Step-by-step solution explanation (Law of Sines/Cosines applied)
  • Ambiguous SSA case: shows 0, 1, or 2 possible triangles
  • Triangle inequality check (validates inputs can form triangle)
  • Heron's formula area calculation
  • Side and angle rounding precision control

About Triangle Calculator

Triangles are the fundamental shape of geometry—used in construction, navigation, surveying, engineering, graphics, and physics. A triangle is defined by six parts: three sides (a, b, c) and three angles (A, B, C). If you know three of these values (including at least one side), our Triangle Calculator solves for the remaining three and calculates area, perimeter, and heights.

Triangle Theorems & Laws Used

Law of Sines: a/sin(A) = b/sin(B) = c/sin(C) = 2R (circumradius)

Used when you know: AAS (two angles + opposite side), ASA (two angles + included side), SSA (two sides + non-included angle—ambiguous case)

Law of Cosines: a² = b² + c² - 2bc×cos(A)

Used when you know: SSS (three sides), SAS (two sides + included angle)

Triangle Angle Sum: A + B + C = 180°

Used automatically for third angle when two are known

Pythagorean Theorem (Right Triangles): a² + b² = c² (where c is hypotenuse)

Our calculator detects right triangles and applies this shortcut.

Area Formulas (Multiple Methods):

  • Base × Height ÷ 2: If height known
  • Heron's Formula: √[s(s-a)(s-b)(s-c)] where s = semiperimeter
  • Side-Angle-Side: ½ × a × b × sin(C)
  • Coordinate method: For vertices input

Input Cases (How to Use)

Case 1: SSS (Three Sides Known)

You know all three side lengths. The triangle is uniquely determined (except degenerate cases).

  • Method: Law of Cosines to find largest angle first, then Law of Sines for others
  • Example: a=5, b=6, c=7
  • Output: Angles A ≈ 44.4°, B ≈ 57.1°, C ≈ 78.5°
  • Check: Sum = 180° ✓

Case 2: SAS (Two Sides + Included Angle)

You know two sides and the angle BETWEEN them.

  • Method: Law of Cosines to find third side, then Law of Sines for remaining angles
  • Example: a=5, b=6, angle C=60° (angle between a and b)
  • Output: Side c ≈ 5.57, Angles A ≈ 50.1°, B ≈ 69.9°

Case 3: ASA (Two Angles + Included Side)

You know two angles and the side BETWEEN them.

  • Method: Find third angle (180 - A - B), then Law of Sines for other sides
  • Example: A=40°, B=60°, side c=10 (between A and B)
  • Output: Angle C=80°, sides a≈6.53, b≈8.79

Case 4: AAS (Two Angles + Non-Included Side)

You know two angles and a side not between them.

  • Method: Find third angle, then Law of Sines
  • Example: A=40°, B=60°, side a=8 (opposite A)
  • Output: Angle C=80°, sides b≈10.78, c≈12.26

Case 5: SSA (Two Sides + Non-Included Angle) - The Ambiguous Case

This is the trickiest case. Depending on measurements, you may get:

  • No solution: The given side is too short to form a triangle
  • One right triangle solution: When angle is 90° or side exactly matches height
  • Two possible triangles: Two different triangles satisfy the same inputs (acute and obtuse possibilities)
  • One unique triangle: Standard case

SSA Ambiguity Rules (given a, b, and angle A):

  • If a ≥ b: One solution (non-ambiguous)
  • If a < b:
  • If a > b×sin(A): Two solutions (acute and obtuse angle B)
  • If a = b×sin(A): One right triangle solution
  • If a < b×sin(A): No solution (impossible triangle)

Our calculator detects the ambiguous case and presents all possible solutions.

Right Triangle Mode (Simplified)

If you toggle "Right Triangle Mode," the calculator assumes angle C = 90° (right angle). Then you only need two inputs (any combination of legs a, b, or hypotenuse c). The calculator solves using:

  • Pythagorean theorem: c² = a² + b²
  • Trigonometric ratios: sin(A) = a/c, cos(A) = b/c, tan(A) = a/b
  • Angles: A + B = 90° (complementary)

Example (Right Triangle): a=3, b=4 → c=5, angles 36.87°, 53.13°, 90°

Additional Outputs

Area:

  • Heron's Formula: √[s(s-a)(s-b)(s-c)] where s = (a+b+c)/2
  • SAS Area: ½ × a × b × sin(C)
  • Base & Height: (base × height) / 2 (if height provided)

Perimeter: a + b + c

Heights (altitudes):

  • h_a = 2×Area / a
  • h_b = 2×Area / b
  • h_c = 2×Area / c

Circumradius (R): R = a / (2×sin(A)) = abc / (4×Area)

Inradius (r): r = (2×Area) / Perimeter

Real-World Applications

Construction & Carpentry:

  • Roof rafters: Right triangle with rise and run. Pitch = rise ÷ run. Rafter length = √(rise² + run²)
  • Stairs: Tread depth (run) and riser height (rise). Diagonal length for stringer.
  • Bracing: Diagonal length for rectangular frames (Pythagorean theorem)
  • Land surveying: Triangulation to measure distances indirectly

Navigation & GPS:

  • Distance between two points: Use law of cosines given coordinates (latitude/longitude)
  • Bearing calculation: Angle from north to destination
  • Triangulation: Locate position using angles from two known points

Physics & Engineering:

  • Force vectors: Resolve forces into components (right triangles)
  • Inclined planes: Determine forces parallel and perpendicular to slope
  • Projectile motion: Range, height, angle relationships (parabolic path uses triangles at launch point)
  • Optics: Light refraction angles (Snell's Law uses triangle geometry in media)

Geography & Mapping:

  • Distance across a river: Measure baseline along shore, sight angles to far point, solve triangle
  • Mountain height: Measure distance from peak at two points, angle of elevation, solve for height
  • Map scaling: Convert map distances to real distances using triangle similarity

Art & Graphic Design:

  • Perspective drawing: Vanishing points create triangle grids
  • 3D modeling: Triangles are fundamental polygons in meshes (every 3D shape is triangulated)
  • Photo composition: Rule of thirds uses triangular visual flow

Examples Walkthrough

Example 1 (SSS): Build a triangular garden bed with sides 8ft, 10ft, 12ft.

  • Input: a=8, b=10, c=12
  • Output angles: A≈41.4°, B≈55.8°, C≈82.8° (all <90°, acute triangle)
  • Area (Heron): s=15, Area=√[15×7×5×3]=√1575≈39.7 sq ft
  • Perimeter: 30 ft

Example 2 (SAS): Two sides of a triangle are 7cm and 9cm with included angle 50°.

  • Input: a=7, b=9, C=50° (between them)
  • Output: c² = 7²+9²-2×7×9×cos(50°) = 49+81-126×0.6428=49+81-81=49, c≈7cm
  • Angles: A≈50.1°, B≈79.9°, C=50°
  • Area: ½×7×9×sin(50°)=31.5×0.766=24.1cm²

Example 3 (ASA): Surveyors measure two angles 35° and 65° at ends of baseline 100m.

  • Input: A=35°, B=65°, c=100 (side between them)
  • Output: C=80° (180-35-65)
  • Sides via Law of Sines: a=100×sin(35°)/sin(80°)≈100×0.574/0.985≈58.3m; b≈100×sin(65°)/sin(80°)≈100×0.906/0.985≈92.0m
  • Area: ½×58.3×92.0×sin(65°)? Wait, easier: ½×a×c×sin(B) = 0.5×58.3×100×0.906≈2,641m²

Example 4 (SSA - Two possibilities): a=10, b=20, A=30°.

  • b×sin(A)=20×0.5=10, so a = exactly b×sin(A) → One right triangle solution: B=90°, C=60°, side c≈17.32

Example 5 (Right Triangle): A ladder leans against wall. Base 6ft from wall, top reaches 15ft high.

  • Input: a=6ft (base), b=15ft (height), right triangle mode.
  • Output: Ladder length c=√(6²+15²)=√(36+225)=√261≈16.16ft
  • Angle at ground: arctan(15/6)≈68.2°, angle at wall: 21.8°

FAQ: Triangle Calculator

What does "SSA ambiguous case" mean?

With two sides and an angle not between them, sometimes 0, 1, or 2 different triangles satisfy the conditions. Our calculator displays all possibilities when this occurs, including the acute and obtuse angle B options.

Can I input angles in degrees, minutes, seconds (DMS)?

Yes, in advanced mode. Examples: 45°30'15" = 45.50417°. Or switch to DMS mode for native entry.

How do I know if my triangle is right, acute, or obtuse?

  • Right: a² + b² = c² (where c is longest side)
  • Acute: a² + b² > c² (plus permutations)
  • Obtuse: a² + b² < c²

Our calculator classifies the triangle type automatically.

What is a degenerate triangle?

When three points are collinear (area=0). Usually happens when triangle inequality fails: a + b = c (or a + c = b, or b + c = a). No valid triangle exists.

Why can't I input only angles?

An infinite number of similar triangles share the same angles but different sizes. You must provide at least one side length to scale the triangle.

How accurate are the results?

To 15 decimal places internally. Displayed results round to 2-4 decimal places or degrees-minutes-seconds as you prefer. For trigonometric calculations, error < 1×10⁻¹⁰.

Triangle Calculator is optimized for fast browser-based use, so you can test multiple scenarios in seconds.

Formula & Logic

  • 01SSS: Use Law of Cosines to find largest angle: cos(A) = (b² + c² - a²)/(2bc). Then Law of Sines for others.
  • 02SAS: Find third side via Law of Cosines: a² = b² + c² - 2bc×cos(A). Then Law of Sines for angle B.
  • 03ASA/AAS: Find third angle (sum=180°), then Law of Sines for sides.
  • 04SSA ambiguous: Compute h = b×sin(A). Compare a to h and b to determine 0/1/2 solutions.
  • 05Area (SSS): Heron: s=(a+b+c)/2, Area = √[s(s-a)(s-b)(s-c)].
  • 06Area (SAS): ½×a×b×sin(C).
  • 07Pythagorean (right triangle): c = √(a² + b²), angles via asin/cos/tan.

Practical Examples

  • 01Baseline check: Use realistic inputs in Triangle Calculator to generate a first-pass estimate.
  • 02Sensitivity check: Change one key input at a time to compare how the output shifts.
  • 03Decision check: Save two or more scenarios and use the differences to choose the better option.

Important Limitations

  • Results depend on the accuracy of your inputs.
  • Displayed values may be rounded for readability.
  • Edge cases can vary based on locale standards, conventions, or input formatting.

Frequently Asked Questions