Sss Triangle Calculator

.sss-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e0e0e0; border-radius: 12px; background-color: #ffffff; color: #333; box-shadow: 0 4px 20px rgba(0,0,0,0.08); } .sss-calc-header { text-align: center; margin-bottom: 30px; } .sss-calc-header h2 { color: #1a73e8; margin-bottom: 10px; font-size: 28px; } .sss-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; } @media (max-width: 600px) { .sss-calc-grid { grid-template-columns: 1fr; } } .sss-input-group { margin-bottom: 15px; } .sss-input-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #555; } .sss-input-group input { width: 100%; padding: 12px; border: 2px solid #ddd; border-radius: 8px; font-size: 16px; transition: border-color 0.3s; box-sizing: border-box; } .sss-input-group input:focus { border-color: #1a73e8; outline: none; } .sss-btn { background-color: #1a73e8; color: white; padding: 14px 20px; border: none; border-radius: 8px; font-size: 18px; font-weight: bold; cursor: pointer; width: 100%; transition: background 0.3s; margin-top: 10px; } .sss-btn:hover { background-color: #1557b0; } .sss-results { background-color: #f8f9fa; border-radius: 10px; padding: 20px; border-left: 5px solid #1a73e8; } .sss-results h3 { margin-top: 0; color: #1a73e8; font-size: 20px; } .sss-result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; } .sss-result-row:last-child { border-bottom: none; } .sss-label { font-weight: 600; color: #666; } .sss-value { font-weight: bold; color: #1a73e8; } .sss-error { color: #d93025; background: #fce8e6; padding: 10px; border-radius: 5px; margin-bottom: 15px; display: none; } .sss-article { margin-top: 40px; line-height: 1.6; color: #444; } .sss-article h2 { color: #222; border-bottom: 2px solid #eee; padding-bottom: 10px; } .sss-article h3 { color: #333; margin-top: 25px; } .sss-article ul { padding-left: 20px; } .sss-article table { width: 100%; border-collapse: collapse; margin: 20px 0; } .sss-article th, .sss-article td { border: 1px solid #ddd; padding: 12px; text-align: left; } .sss-article th { background-color: #f2f2f2; }

SSS Triangle Calculator

Enter the lengths of all three sides to find angles, area, and perimeter.

Invalid triangle: The sum of any two sides must be greater than the third side.

Calculated Results

Angle A:
Angle B:
Angle C:
Area:
Perimeter:
Semi-perimeter (s):

Understanding the SSS (Side-Side-Side) Triangle Theorem

The SSS (Side-Side-Side) theorem states that if three sides of one triangle are congruent to three sides of another triangle, then the two triangles are congruent. In trigonometry, having three sides allows us to solve for all internal angles using the Law of Cosines.

How to Calculate Angles from Three Sides

To find the angles of a triangle when you only know the side lengths (a, b, and c), we use the Law of Cosines formula rearranged to solve for the angle:

  • Angle A: cos(A) = (b² + c² – a²) / 2bc
  • Angle B: cos(B) = (a² + c² – b²) / 2ac
  • Angle C: cos(C) = (a² + b² – c²) / 2ab

The Triangle Inequality Theorem

Before calculating, it is vital to ensure that the three side lengths can actually form a triangle. The Triangle Inequality Theorem states that for any triangle, the sum of the lengths of any two sides must be strictly greater than the length of the remaining side:

ConditionMust be True
Side A + Side B> Side C
Side A + Side C> Side B
Side B + Side C> Side A

Calculating Area with Heron's Formula

Once you have the three sides, you can find the area without knowing the height using Heron's Formula:

1. Calculate the semi-perimeter (s): s = (a + b + c) / 2

2. Calculate Area: Area = √[s(s – a)(s – b)(s – c)]

Practical Example

Suppose you have a triangle with sides a = 5, b = 6, and c = 7.

  • Perimeter: 5 + 6 + 7 = 18
  • Semi-perimeter (s): 18 / 2 = 9
  • Angle A: arccos((6² + 7² – 5²) / (2 * 6 * 7)) ≈ 44.4°
  • Area: √[9(9-5)(9-6)(9-7)] = √[9 * 4 * 3 * 2] = √216 ≈ 14.7 units²
function calculateSSSTriangle() { var a = parseFloat(document.getElementById('sideA').value); var b = parseFloat(document.getElementById('sideB').value); var c = parseFloat(document.getElementById('sideC').value); var errorDiv = document.getElementById('errorMessage'); var resultsArea = document.getElementById('resultsArea'); // Reset errorDiv.style.display = 'none'; resultsArea.style.display = 'none'; if (isNaN(a) || isNaN(b) || isNaN(c) || a <= 0 || b <= 0 || c c && a + c > b && b + c > a)) { errorDiv.innerText = "Triangle Inequality Violation: The sum of two sides must be greater than the third."; errorDiv.style.display = 'block'; return; } // Law of Cosines for Angles in Radians var cosA = (b * b + c * c – a * a) / (2 * b * c); var cosB = (a * a + c * c – b * b) / (2 * a * c); var cosC = (a * a + b * b – c * c) / (2 * a * b); // Convert to Degrees var angleA = Math.acos(cosA) * (180 / Math.PI); var angleB = Math.acos(cosB) * (180 / Math.PI); var angleC = Math.acos(cosC) * (180 / Math.PI); // Perimeter and Heron's Formula var perimeter = a + b + c; var s = perimeter / 2; var area = Math.sqrt(s * (s – a) * (s – b) * (s – c)); // Display Results document.getElementById('resAngleA').innerText = angleA.toFixed(2) + "°"; document.getElementById('resAngleB').innerText = angleB.toFixed(2) + "°"; document.getElementById('resAngleC').innerText = angleC.toFixed(2) + "°"; document.getElementById('resArea').innerText = area.toFixed(4); document.getElementById('resPerimeter').innerText = perimeter.toFixed(2); document.getElementById('resSemi').innerText = s.toFixed(2); resultsArea.style.display = 'block'; }

Leave a Comment