Trigonometric Ratios Calculator (SOH-CAH-TOA)

Find all six trigonometric ratios — sine, cosine, tangent, cotangent, secant, and cosecant — from any two sides of a right triangle, plus the angle.

Loading calculator…

The six trigonometric ratios

Every trigonometric ratio compares two sides of a right triangle relative to one of its acute angles, θ\theta. The three sides, named by their relationship to θ\theta:

  • Opposite — the leg across the triangle from θ\theta (never touches it).
  • Adjacent — the other leg, next to θ\theta (touches it, but isn't the hypotenuse).
  • Hypotenuse — the longest side, opposite the right angle (touches θ\theta too).
RatioDefinitionReciprocal of
sinθ\sin\thetaopp / hyp1/cscθ1/\csc\theta
cosθ\cos\thetaadj / hyp1/secθ1/\sec\theta
tanθ\tan\thetaopp / adj1/cotθ1/\cot\theta
cotθ\cot\thetaadj / opp1/tanθ1/\tan\theta
secθ\sec\thetahyp / adj1/cosθ1/\cos\theta
cscθ\csc\thetahyp / opp1/sinθ1/\sin\theta
Tip: SOH-CAH-TOA covers only the first three: Sin = Opposite/Hypotenuse, Cos = Adjacent/Hypotenuse, Tan = Opposite/Adjacent. The last three (cot, sec, csc) are simply those three flipped upside down.

Worked example: the 3-4-5 right triangle

Given: opposite = 3, adjacent = 4 (a classic Pythagorean triple — the hypotenuse comes out exactly whole).

hyp=32+42=25=5\text{hyp} = \sqrt{3^2+4^2} = \sqrt{25} = 5

sinθ=35=0.6cosθ=45=0.8tanθ=34=0.75\sin\theta = \frac{3}{5} = 0.6 \qquad \cos\theta = \frac{4}{5} = 0.8 \qquad \tan\theta = \frac{3}{4} = 0.75

cotθ=431.333secθ=54=1.25cscθ=531.667\cot\theta = \frac{4}{3} \approx 1.333 \qquad \sec\theta = \frac{5}{4} = 1.25 \qquad \csc\theta = \frac{5}{3} \approx 1.667

θ=arctan(3/4)36.87°\theta = \arctan(3/4) \approx 36.87°

Check with the Pythagorean identity: 0.62+0.82=0.36+0.64=10.6^2 + 0.8^2 = 0.36 + 0.64 = 1. ✓

Solving from any two sides

Not every problem hands you the two legs directly — this calculator covers all three pairings:

  • Opposite + adjacent (as above): hypotenuse solved via opp2+adj2\sqrt{\text{opp}^2+\text{adj}^2}.
  • Opposite + hypotenuse: adjacent solved via hyp2opp2\sqrt{\text{hyp}^2-\text{opp}^2}. Example: opposite = 3, hypotenuse = 5 → adjacent = 259=4\sqrt{25-9} = 4, the same 3-4-5 triangle and the same six ratios.
  • Adjacent + hypotenuse: opposite solved via hyp2adj2\sqrt{\text{hyp}^2-\text{adj}^2}. Example: adjacent = 4, hypotenuse = 5 → opposite = 2516=3\sqrt{25-16}=3 — again the same triangle.

Whichever two sides you start from, the third is solved first, and every ratio follows from the same complete triangle.

When a ratio is undefined

A leg of length 0 is a degenerate triangle (flattened to a line), not invalid input:

  • Adjacent = 0: tanθ=opp/0\tan\theta = \text{opp}/0 and secθ=hyp/0\sec\theta = \text{hyp}/0 are undefined; θ=90°\theta = 90°.
  • Opposite = 0: cotθ=adj/0\cot\theta = \text{adj}/0 and cscθ=hyp/0\csc\theta = \text{hyp}/0 are undefined; θ=0°\theta = 0°.

Either way, the other four ratios are still perfectly well-defined — this calculator shows "undefined" only for the two that genuinely divide by zero, not the whole result.

Common mistakes

  • Swapping opposite and adjacent. Both are legs, but which is "opposite" depends entirely on which angle you call θ\theta — always identify θ\theta first.
  • Confusing tan with cot. tanθ=opp/adj\tan\theta = \text{opp}/\text{adj}; cotθ\cot\theta is the same ratio upside down.
  • Assuming a negative or zero hypotenuse is fine. The hypotenuse must be strictly positive and strictly the longest side — a zero or negative hypotenuse, or one shorter than a given leg, has no valid triangle.

Where this shows up

  • Indirect measurement: finding a building's height from its shadow and the sun's angle of elevation is a direct SOH-CAH-TOA application.
  • Foundation of the unit circle: these same six ratios, generalized to all angles (not just 0°–90°), define the trigonometric functions and their inverses used throughout trigonometry.
  • Solving general triangles: the Law of Sines extends these right-triangle ratios to any triangle, acute or obtuse.

This calculator is a natural companion to Right Triangle — that calculator solves the full triangle (sides, area, perimeter, both acute angles); this one focuses specifically on the six named ratios at one of those angles, given any two sides.

Frequently asked questions

What are the six trigonometric ratios?
Sine, cosine, tangent, and their reciprocals cotangent, secant, cosecant. Each is a ratio of two sides of a right triangle relative to an angle θ\theta: sinθ=opphyp\sin\theta = \tfrac{\text{opp}}{\text{hyp}}, cosθ=adjhyp\cos\theta = \tfrac{\text{adj}}{\text{hyp}}, tanθ=oppadj\tan\theta = \tfrac{\text{opp}}{\text{adj}}, and cotθ\cot\theta, secθ\sec\theta, cscθ\csc\theta are their reciprocals.
What does SOH-CAH-TOA mean?
A memory aid for the three primary ratios: **S**ine = **O**pposite/**H**ypotenuse, **C**osine = **A**djacent/**H**ypotenuse, **T**angent = **O**pposite/**A**djacent. The other three ratios (cot, sec, csc) are just the flip of tan, cos, and sin.
How do I tell the opposite side from the adjacent side?
Both depend on which angle you call θ\theta. The opposite side is the one across the triangle from θ\theta — it never touches that angle. The adjacent side is the other leg, the one that DOES touch θ\theta but isn't the hypotenuse.
Can I find the ratios if I only know two sides?
Yes — this is exactly what this calculator does. Given any two of {opposite, adjacent, hypotenuse}, the third is solved by the Pythagorean theorem first, then all six ratios follow directly.
What if a leg is exactly 0?
A zero-length leg is a degenerate (flat) triangle, not an error. If the adjacent leg is 0, tanθ\tan\theta and secθ\sec\theta are undefined (division by zero) while sin, cos, cot, and csc are still defined. If the opposite leg is 0, cot and csc are undefined instead.
Why must the hypotenuse be the longest side?
The hypotenuse is always opposite the right angle, and the right angle is the largest angle in a right triangle — the longest side is always opposite the largest angle. If you enter a hypotenuse that isn't longer than the known leg, no right triangle can close, so this calculator reports that no such triangle exists.
How is the angle θ found?
Once the opposite and adjacent legs are both known, θ=arctan(opp/adj)\theta = \arctan(\text{opp}/\text{adj}). For the 3-4-5 triangle, θ=arctan(3/4)36.87°\theta = \arctan(3/4) \approx 36.87°.
How are these ratios related to each other?
They come in reciprocal pairs — cotθ=1/tanθ\cot\theta = 1/\tan\theta, secθ=1/cosθ\sec\theta = 1/\cos\theta, cscθ=1/sinθ\csc\theta = 1/\sin\theta — and tanθ=sinθ/cosθ\tan\theta = \sin\theta/\cos\theta. They also satisfy the Pythagorean identity sin2θ+cos2θ=1\sin^2\theta + \cos^2\theta = 1.

Related calculators