# How do I solve my right triangle?

Solves a right triangle from any two sides, or a side and an angle: all three sides, both acute angles, the area, the perimeter, and the height.

- Page: https://www.acalculator.org/math/right-triangle-calculator
- JSON spec: https://www.acalculator.org/math/right-triangle-calculator.json
- Version: 3f71d5951955

## Default answer

Example with the default inputs (Leg a 3, Leg b 4): A right triangle with legs 3 and 4 has a hypotenuse of 5 and angles of 36.869898° and 53.130102°.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | Leg a | The side opposite angle α; it meets leg b at the right angle. |
| b | Leg b | The side opposite angle β; it meets leg a at the right angle. |
| c | Hypotenuse c | The longest side, opposite the right angle. |
| alpha | Angle α | The acute angle opposite leg a, between leg b and the hypotenuse. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| hypotenuse | Hypotenuse c | The longest side, opposite the right angle. |
| legA | Leg a | The side opposite angle α. |
| legB | Leg b | The side opposite angle β. |
| angleA | Angle α | The acute angle opposite leg a. |
| angleB | Angle β | The acute angle opposite leg b: 90° − α. |
| area | Area | Half the product of the legs: a × b ÷ 2. |
| perimeter | Perimeter | The three sides added: a + b + c. |
| height | Height to the hypotenuse | The distance from the right angle to the hypotenuse: a × b ÷ c. |

## Method

a² + b² = c², sin α = a ÷ c, cos α = b ÷ c, tan α = a ÷ b, and β = 90° − α.

## Assumptions

- The angle between legs a and b is 90°; α is opposite a and β is opposite b.
- Enter two of a, b, c and α. To start from β, enter it as α and swap the names of the legs.
- Sides are more than 0, in one unit; α is more than 0° and less than 90°. A third value must fit the first two.

## Worked examples

1. a = 3, b = 4 gives hypotenuse = 5, angleA = 0.643501, angleB = 0.927295, area = 6, perimeter = 12, height = 2.4. Source: hand calculation in content.mdx: c = √(9 + 16) = 5; α = atan(3/4); Python 3: math.atan2(3, 4) = 0.6435011087932844, math.pi/2 - math.atan2(3, 4) = 0.9272952180016122.
2. c = 10, alpha = 0.523599 gives legA = 5, legB = 8.660254, angleB = 1.047198, area = 21.650635. Source: hand calculation in content.mdx: a = 10 × sin 30° = 5, b = 10 × cos 30° = 5√3; Python 3: 10*math.sin(math.pi/6) = 4.999999999999999, 10*math.cos(math.pi/6) = 8.660254037844387, math.pi/2 - math.pi/6 = 1.0471975511965979, a*b/2 = 21.650635094610966.
3. b = 12, c = 13 gives legA = 5, angleA = 0.394791, perimeter = 30, height = 4.615385. Source: hand calculation in content.mdx: a = √(169 − 144) = 5; Python 3: math.atan2(5, 12) = 0.3947911196997615, 5*12/13 = 4.615384615384615.
4. a = 7, alpha = 0.785398 gives legB = 7, hypotenuse = 9.899495, angleB = 0.785398, area = 24.5. Source: hand calculation in content.mdx: β = 90° − 45° = 45°, so b = a = 7 and c = 7√2; Python 3: 7/math.sin(math.pi/4) = 9.899494936611665, 7/math.tan(math.pi/4) = 7.000000000000001.
5. a = 3, b = 4, c = 5 gives hypotenuse = 5, area = 6. Source: hand calculation in content.mdx: 9 + 16 = 25, so all three sides fit.

## FAQ

### How do I solve a right triangle?

You need two values besides the right angle, and at least one must be a side. With two sides, use a² + b² = c² for the third side and a sine, cosine or tangent for an angle. With a side and an angle, use sine, cosine or tangent for the other sides. The two acute angles always add up to 90°, so one gives the other.

### What does SOH CAH TOA mean?

It is a way to remember the three ratios for an acute angle of a right triangle: Sine = Opposite ÷ Hypotenuse, Cosine = Adjacent ÷ Hypotenuse, Tangent = Opposite ÷ Adjacent. For angle α here, the opposite side is a, the adjacent side is b, and the hypotenuse is c.

### Why can I not solve a triangle from its angles alone?

Angles fix the shape of a right triangle but not its size. A triangle with angles 30° and 60° can have a hypotenuse of 1, 10 or 1,000. That is why the calculator asks for one angle, α, and needs at least one side with it.

### I know angle β. How do I enter it?

Enter it as α and swap the names of the legs: the leg opposite your angle is a, and the other leg is b. Or enter 90° − β as α, since the two acute angles always add up to 90°.

### How do I find the area of a right triangle?

Multiply the two legs and halve the result: area = a × b ÷ 2. With legs 3 and 4, the area is 6. The legs are the base and the height, because they meet at a right angle.

### What is the height to the hypotenuse?

The shortest distance from the right angle to the hypotenuse. It equals a × b ÷ c, because the area can be written both as a × b ÷ 2 and as c × height ÷ 2. For legs 3 and 4 and hypotenuse 5, the height is 12 ÷ 5 = 2.4.

### Can I type the angle in radians?

Yes. Pick rad next to the angle box. 90° is π/2 radians, about 1.5708, so an acute angle must be between 0 and about 1.5708 radians. Angle β is always shown in degrees.

## Sources

- OpenStax, Algebra and Trigonometry 2e, section 7.2 Right Triangle Trigonometry: https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-2-right-triangle-trigonometry
- OpenStax, Elementary Algebra 2e, section 3.4 Solve Geometry Applications: Triangles, Rectangles, and the Pythagorean Theorem: https://openstax.org/books/elementary-algebra-2e/pages/3-4-solve-geometry-applications-triangles-rectangles-and-the-pythagorean-theorem
