Calculate Sides of Right Triangle

Right Triangle Side & Angle Calculator

Enter any two known values (two sides, or one side and one acute angle) of a right triangle to calculate the remaining sides and angles. Angle C is always 90 degrees.

Understanding the Right Triangle

A right triangle is a special type of triangle that has one angle measuring exactly 90 degrees. This 90-degree angle is often denoted by a square symbol. The side opposite the right angle is called the hypotenuse, which is always the longest side of the triangle. The other two sides are called legs.

Right triangles are fundamental in geometry, trigonometry, and various fields of science and engineering. They allow us to use powerful mathematical tools like the Pythagorean theorem and trigonometric ratios to find unknown side lengths or angles.

The Pythagorean Theorem

The most famous theorem related to right triangles is the Pythagorean Theorem, which states that the square of the length of the hypotenuse (c) is equal to the sum of the squares of the lengths of the two legs (a and b). Mathematically, this is expressed as:

a² + b² = c²

Where:

  • a and b are the lengths of the two legs.
  • c is the length of the hypotenuse.

This theorem is incredibly useful when you know the lengths of two sides of a right triangle and need to find the third side.

Example: If a right triangle has legs of length 3 and 4, you can find the hypotenuse:

3² + 4² = c²

9 + 16 = c²

25 = c²

c = √25 = 5

Trigonometric Ratios (SOH CAH TOA)

When you know one side and one acute angle (an angle less than 90 degrees) of a right triangle, you can use trigonometric ratios to find the other sides and angles. These ratios relate the angles of a right triangle to the ratios of its side lengths. The three primary ratios are Sine, Cosine, and Tangent, often remembered by the acronym SOH CAH TOA:

  • SOH: Sine = Opposite / Hypotenuse (sin(angle) = opposite / hypotenuse)
  • CAH: Cosine = Adjacent / Hypotenuse (cos(angle) = adjacent / hypotenuse)
  • TOA: Tangent = Opposite / Adjacent (tan(angle) = opposite / adjacent)

The "opposite" and "adjacent" sides depend on which acute angle you are referencing. The hypotenuse is always the same.

Example: If you have a right triangle with Angle A = 30 degrees and Side A (opposite Angle A) = 6 units:

  • To find Hypotenuse C: sin(30°) = 6 / CC = 6 / sin(30°) = 6 / 0.5 = 12
  • To find Side B (adjacent to Angle A): tan(30°) = 6 / BB = 6 / tan(30°) ≈ 6 / 0.5774 ≈ 10.3923
  • Angle B would be 90° - 30° = 60°.

How to Use the Calculator

Our Right Triangle Calculator simplifies these calculations for you. Simply input any two known values into the corresponding fields:

  1. Side A: The length of the leg opposite Angle A.
  2. Side B: The length of the leg opposite Angle B.
  3. Hypotenuse C: The length of the longest side, opposite the 90-degree angle.
  4. Angle A: The measure of acute Angle A in degrees.

After entering two values, click the "Calculate" button. The calculator will automatically determine the remaining side lengths and acute angles, displaying them in the result area. Remember, Angle C is always 90 degrees in a right triangle.

Important: Ensure you only enter values for two fields. Entering more or fewer than two values will result in an error message.

.calculator-container { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f9f9f9; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); max-width: 700px; margin: 20px auto; color: #333; } .calculator-container h2 { text-align: center; color: #0056b3; margin-bottom: 20px; } .calculator-content p { margin-bottom: 15px; line-height: 1.6; } .input-group { margin-bottom: 15px; display: flex; flex-direction: column; } .input-group label { margin-bottom: 5px; font-weight: bold; color: #555; } .input-group input[type="number"] { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; width: 100%; box-sizing: border-box; } .calculate-button { background-color: #007bff; color: white; padding: 12px 20px; border: none; border-radius: 4px; font-size: 18px; cursor: pointer; display: block; width: 100%; margin-top: 20px; transition: background-color 0.3s ease; } .calculate-button:hover { background-color: #0056b3; } .result-area { margin-top: 25px; padding: 15px; background-color: #e9f7ef; border: 1px solid #d4edda; border-radius: 4px; min-height: 50px; color: #155724; } .result-area h3 { color: #0056b3; margin-top: 0; margin-bottom: 10px; } .result-area p { margin-bottom: 8px; } .result-area p strong { color: #333; } .article-content { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; } .article-content h3 { color: #0056b3; margin-top: 20px; margin-bottom: 10px; } .article-content p { line-height: 1.6; margin-bottom: 10px; } .article-content ul { list-style-type: disc; margin-left: 20px; margin-bottom: 10px; } .article-content ol { list-style-type: decimal; margin-left: 20px; margin-bottom: 10px; } .article-content code { background-color: #e0e0e0; padding: 2px 4px; border-radius: 3px; font-family: 'Courier New', Courier, monospace; } function calculateTriangle() { var sideA_val = parseFloat(document.getElementById('inputSideA').value); var sideB_val = parseFloat(document.getElementById('inputSideB').value); var hypotenuseC_val = parseFloat(document.getElementById('inputHypotenuseC').value); var angleA_val = parseFloat(document.getElementById('inputAngleA').value); var inputs = []; if (!isNaN(sideA_val) && sideA_val > 0) inputs.push({ id: 'sideA', value: sideA_val }); if (!isNaN(sideB_val) && sideB_val > 0) inputs.push({ id: 'sideB', value: sideB_val }); if (!isNaN(hypotenuseC_val) && hypotenuseC_val > 0) inputs.push({ id: 'hypotenuseC', value: hypotenuseC_val }); if (!isNaN(angleA_val) && angleA_val > 0 && angleA_val = hC) { resultDiv.innerHTML = 'Side A must be shorter than the hypotenuse.'; return; } sB = Math.sqrt(hC * hC – sA * sA); aA_deg = toDegrees(Math.asin(sA / hC)); aB_deg = 90 – aA_deg; } else if ((input1.id === 'sideB' && input2.id === 'hypotenuseC') || (input1.id === 'hypotenuseC' && input2.id === 'sideB')) { sB = (input1.id === 'sideB') ? input1.value : input2.value; hC = (input1.id === 'hypotenuseC') ? input1.value : input2.value; if (sB >= hC) { resultDiv.innerHTML = 'Side B must be shorter than the hypotenuse.'; return; } sA = Math.sqrt(hC * hC – sB * sB); aB_deg = toDegrees(Math.asin(sB / hC)); aA_deg = 90 – aB_deg; } // One side and one angle (Angle A) else if ((input1.id === 'sideA' && input2.id === 'angleA') || (input1.id === 'angleA' && input2.id === 'sideA')) { sA = (input1.id === 'sideA') ? input1.value : input2.value; aA_deg = (input1.id === 'angleA') ? input1.value : input2.value; var aA_rad = toRadians(aA_deg); hC = sA / Math.sin(aA_rad); sB = sA / Math.tan(aA_rad); aB_deg = 90 – aA_deg; } else if ((input1.id === 'sideB' && input2.id === 'angleA') || (input1.id === 'angleA' && input2.id === 'sideB')) { sB = (input1.id === 'sideB') ? input1.value : input2.value; aA_deg = (input1.id === 'angleA') ? input1.value : input2.value; var aA_rad = toRadians(aA_deg); hC = sB / Math.cos(aA_rad); sA = sB * Math.tan(aA_rad); aB_deg = 90 – aA_deg; } else if ((input1.id === 'hypotenuseC' && input2.id === 'angleA') || (input1.id === 'angleA' && input2.id === 'hypotenuseC')) { hC = (input1.id === 'hypotenuseC') ? input1.value : input2.value; aA_deg = (input1.id === 'angleA') ? input1.value : input2.value; var aA_rad = toRadians(aA_deg); sA = hC * Math.sin(aA_rad); sB = hC * Math.cos(aA_rad); aB_deg = 90 – aA_deg; } else { resultDiv.innerHTML = 'Invalid combination of inputs. Please ensure you provide two distinct values.'; return; } // Final check for NaN or invalid results (e.g., negative side lengths) if (isNaN(sA) || isNaN(sB) || isNaN(hC) || isNaN(aA_deg) || isNaN(aB_deg) || sA <= 0 || sB <= 0 || hC <= 0 || aA_deg <= 0 || aB_deg <= 0) { resultDiv.innerHTML = 'Error in calculation. Please check your inputs and ensure they form a valid triangle.'; } else { resultDiv.innerHTML = '

Calculated Triangle Properties:

' + 'Side A: ' + sA.toFixed(4) + " + 'Side B: ' + sB.toFixed(4) + " + 'Hypotenuse C: ' + hC.toFixed(4) + " + 'Angle A: ' + aA_deg.toFixed(4) + ' degrees' + 'Angle B: ' + aB_deg.toFixed(4) + ' degrees' + 'Angle C: 90 degrees'; } }

Leave a Reply

Your email address will not be published. Required fields are marked *