Trigonometry Calculator
Solve a complete right triangle from any two known values. Choose a mode, enter two measurements, and the calculator returns every side, angle, the altitude to the hypotenuse, perimeter, area, and the sine, cosine, and tangent of angle A. Results are shown in degrees or radians with full step-by-step working.
Formula
Worked example
Given legs a = 3 and b = 4: the hypotenuse is c = sqrt(3^2 + 4^2) = 5. Angle A = arctan(3/4) = 36.87 deg, B = 53.13 deg. Area = 0.5 x 3 x 4 = 6 sq units. Perimeter = 3 + 4 + 5 = 12 units. Altitude h = (3 x 4)/5 = 2.4 units. sin(A) = 0.6, cos(A) = 0.8, tan(A) = 0.75. This is the classic 3-4-5 Pythagorean triple.
How the right-triangle solver works
A right triangle has one fixed 90-degree angle, and that single fact ties all of its parts together. The side opposite the right angle is the hypotenuse (c), and the two shorter sides are the legs (a and b). The Pythagorean theorem (c^2 = a^2 + b^2) connects the three sides, while the trigonometric ratios sine, cosine, and tangent link the sides to the acute angles. Sine of an angle equals the opposite leg over the hypotenuse; cosine equals the adjacent leg over the hypotenuse; tangent equals the opposite leg over the adjacent leg. Because any two independent values fully determine the triangle, the calculator reconstructs every remaining side and angle from just the pair you provide. It also computes the altitude (the perpendicular from the right-angle vertex to the hypotenuse), the perimeter, and all three primary trig ratios for angle A.
Five solving modes including area-and-side
Most right-triangle tools only offer three or four input combinations. This calculator adds a fifth mode: area and one leg. Because the area of a right triangle is half the product of its two legs (area = 0.5 x a x b), you can rearrange to get b = 2 x area / a, then apply the Pythagorean theorem and arctangent as normal. The other four modes cover: two legs (use Pythagorean theorem and arctangent); one leg and the hypotenuse (rearranged Pythagorean theorem and arcsine); one leg and its opposite angle (sine and tangent ratios); and the hypotenuse and one angle (sine and cosine). In every mode the remaining sides and angles are found by the minimum number of steps, without any iterative solving.
Degrees and radians
The angle unit selector at the top of the form controls both input and output. In degree mode, enter angles between 0 and 90 and read results in the same unit. In radian mode, the equivalent range is 0 to pi/2 (approximately 1.5708 rad). The two modes are mathematically identical since the calculator converts internally before computing. Radians are the natural unit for calculus and most programming languages; degrees are more intuitive for everyday geometry. Switching the selector instantly recalculates all results without re-entering numbers.
Altitude, perimeter, and trig ratios
Beyond the five basic triangle parts (a, b, c, A, B), the calculator reports three extra quantities that competitors often omit. The altitude h is the perpendicular segment from the right-angle vertex C to the hypotenuse; its formula is h = a x b / c. It is useful in geometry proofs and in finding the area of sub-triangles formed when the altitude divides the original triangle. The perimeter P = a + b + c is the total fence length around the triangle, handy in construction and surveying. The trig ratios sin(A), cos(A), and tan(A) are listed as outputs so students can read off the values directly without a separate calculator. Together these extras turn a simple solver into a one-stop reference.
Special right triangles and Pythagorean triples
Two special right-triangle families appear in almost every geometry and trigonometry course. In a 45-45-90 triangle the two legs are equal, the acute angles are both 45 degrees, and the hypotenuse is the leg times the square root of 2 (approximately 1.4142). In a 30-60-90 triangle the sides are in the ratio 1 : sqrt(3) : 2, so the shorter leg is half the hypotenuse. Pythagorean triples are integer-valued triples (a, b, c) that satisfy a^2 + b^2 = c^2. The simplest is 3-4-5; scaling it gives 6-8-10, 9-12-15, and so on. Other primitive triples include 5-12-13, 8-15-17, 7-24-25, and 20-21-29. The insight panel flags these when your inputs land near a special case.
Common pitfalls and limitations
This tool solves right triangles only and assumes one angle is exactly 90 degrees. For triangles with no right angle you need the Law of Sines or the Law of Cosines. When you enter a leg and the hypotenuse, the hypotenuse must be strictly longer than the leg; if not, no real triangle exists and the results are left blank. In radian mode make sure your angle is between 0 and pi/2 (0 to roughly 1.5708); entering a value outside that range returns no result. Keep every length in the same unit, since the calculator has no built-in length conversion. Displayed values are rounded for readability, but the underlying computation is carried out at full floating-point precision.
Right-triangle formulas and special cases
| Given | Find using | Formula |
|---|---|---|
| Both legs (a, b) | Hypotenuse | c = sqrt(a^2 + b^2) |
| Both legs (a, b) | Angle A | A = arctan(a / b) |
| Leg a, hypotenuse c | Leg b | b = sqrt(c^2 - a^2) |
| Leg a, hypotenuse c | Angle A | A = arcsin(a / c) |
| Leg a, angle A | Hypotenuse | c = a / sin(A) |
| Leg a, angle A | Leg b | b = a / tan(A) |
| Hypotenuse c, angle A | Leg a | a = c x sin(A) |
| Hypotenuse c, angle A | Leg b | b = c x cos(A) |
| Area, leg a | Leg b | b = 2 x area / a |
| Any two sides | Altitude h | h = a x b / c |
| 30-60-90 triangle | Side ratios | 1 : sqrt(3) : 2 |
| 45-45-90 triangle | Side ratios | 1 : 1 : sqrt(2) |
C is the 90-degree angle; a and b are the legs; c is the hypotenuse; A is opposite a; B is opposite b; h is the altitude to c.
Frequently asked questions
What is the difference between the legs and the hypotenuse?
The hypotenuse is the longest side of a right triangle and always sits opposite the 90-degree angle. The other two sides, called the legs (or catheti), form the right angle between them. The Pythagorean theorem c^2 = a^2 + b^2 relates them, so the hypotenuse is always longer than either leg.
Why must I enter angles between 0 and 90 degrees (or 0 and pi/2 radians)?
In a right triangle one angle is fixed at exactly 90 degrees, and all three angles must sum to 180 degrees. That leaves 90 degrees split between the two acute angles, so each must be strictly greater than 0 and less than 90. Entering 90 degrees or more would make the triangle degenerate or impossible.
Can this calculator solve triangles that have no right angle?
No. This solver assumes one angle is exactly 90 degrees and uses the Pythagorean theorem and SOH-CAH-TOA ratios, which are specific to right triangles. For an oblique triangle (one with no right angle) you need the Law of Sines (a/sin A = b/sin B = c/sin C) or the Law of Cosines (c^2 = a^2 + b^2 - 2ab cos C).
What is the altitude to the hypotenuse and why does it matter?
The altitude h is the perpendicular segment drawn from the right-angle vertex to the hypotenuse. Its length is h = a x b / c. The altitude splits the original right triangle into two smaller triangles that are both similar to each other and to the original, a relationship known as the geometric mean. It also gives the height of the triangle when the hypotenuse is treated as the base, so area = 0.5 x c x h.
What are Pythagorean triples?
Pythagorean triples are sets of three positive whole numbers (a, b, c) that exactly satisfy a^2 + b^2 = c^2. The most famous is 3-4-5 (9 + 16 = 25). Other common triples are 5-12-13, 8-15-17, 7-24-25, and 20-21-29. Any multiple of a triple is also a triple, so 6-8-10 and 9-12-15 also work. They arise naturally in construction and navigation because they give exact right angles without irrational numbers.
How do I switch between degrees and radians?
Use the "Angle unit" selector at the top of the form. In degrees, enter angles from 0 to 90. In radians, enter values from 0 to pi/2 (approximately 1.5708). All displayed angle outputs update automatically. The underlying math is identical; the calculator simply converts the display unit before showing the result.