How this trigonometry calculator works
Trigonometry relates the angles of a triangle to the ratios of its side lengths. The three primary functions are sine, cosine and tangent, summarised by the mnemonic SOH-CAH-TOA: sine is the opposite side over the hypotenuse, cosine is the adjacent side over the hypotenuse, and tangent is the opposite over the adjacent. The remaining three functions are their reciprocals — cosecant is 1/sin, secant is 1/cos and cotangent is 1/tan.
Because JavaScript's built-in math works in radians, this calculator converts your input first. If you pick degrees, it multiplies by π/180 before evaluating; if you pick radians, it uses the angle as-is. Inverse functions run the conversion in reverse, returning the principal angle in whichever unit you selected.
Reference note: results are rounded to a sensible number of decimals. Functions that divide by zero — such as tan(90°), cot(0°), sec(90°) and csc(0°) — are reported as undefined rather than as an enormous floating-point number.
Common angles reference
Exact values of the three primary functions at the most-used angles:
| Angle | sin | cos | tan |
|---|---|---|---|
| 0° | 0 | 1 | 0 |
| 30° | 1/2 (0.5) | √3/2 (≈0.8660) | 1/√3 (≈0.5774) |
| 45° | √2/2 (≈0.7071) | √2/2 (≈0.7071) | 1 |
| 60° | √3/2 (≈0.8660) | 1/2 (0.5) | √3 (≈1.7321) |
| 90° | 1 | 0 | undefined |
Frequently asked questions
- How do I calculate sine, cosine and tangent?
- Enter an angle and choose degrees or radians. Sine is opposite / hypotenuse, cosine is adjacent / hypotenuse, and tangent is opposite / adjacent (the same as sine divided by cosine). This calculator evaluates all six functions automatically.
- What is SOH-CAH-TOA?
- A memory aid for the three primary trig ratios in a right triangle: Sine = Opposite / Hypotenuse, Cosine = Adjacent / Hypotenuse, Tangent = Opposite / Adjacent. The reciprocals are cosecant (1/sin), secant (1/cos) and cotangent (1/tan).
- What is the difference between degrees and radians?
- Degrees split a full circle into 360 parts; radians measure angle by arc length, so a full circle is 2π radians. Multiply degrees by π/180 to get radians, or radians by 180/π to get degrees. The unit toggle handles this for you.
- Why is tan(90°) undefined?
- Tangent equals sine divided by cosine, and at 90° the cosine is 0, so it divides by zero. The same applies to cot(0°), sec(90°) and csc(0°). This tool shows "undefined" instead of a huge rounding artefact.
- What are inverse trigonometric functions?
- Inverse functions (arcsin, arccos, arctan) take a ratio and return the angle. arcsin and arccos accept values from −1 to 1 only, while arctan accepts any real number. The result is the principal angle in your chosen unit.
- What is sin(30)?
- sin(30°) equals exactly 0.5. Other handy values are cos(60°) = 0.5, sin(45°) = cos(45°) ≈ 0.7071, sin(60°) = cos(30°) ≈ 0.8660, and tan(45°) = 1.