Sin Cos Tan Calculator

Sin Cos Tan Calculator

Degrees (°) Radians (rad)

Calculation Results

Sine (sin):
Cosecant (csc):
Cosine (cos):
Secant (sec):
Tangent (tan):
Cotangent (cot):
function calculateTrigonometry() { var val = document.getElementById('angleInput').value; var unit = document.getElementById('unitType').value; var resultDiv = document.getElementById('trigResults'); if (val === "" || isNaN(val)) { alert("Please enter a valid numeric angle."); return; } var angle = parseFloat(val); var rad; if (unit === "degrees") { rad = angle * (Math.PI / 180); } else { rad = angle; } var s = Math.sin(rad); var c = Math.cos(rad); var t = Math.tan(rad); // Rounding function function formatVal(num) { if (Math.abs(num) 1e15) return "Undefined"; return Number(num.toFixed(6)); } // Standard Functions document.getElementById('sinRes').innerText = formatVal(s); document.getElementById('cosRes').innerText = formatVal(c); // Handle Tangent Undefined (e.g. 90 degrees) if (Math.abs(c) < 1e-15) { document.getElementById('tanRes').innerText = "Undefined"; } else { document.getElementById('tanRes').innerText = formatVal(t); } // Reciprocal Functions document.getElementById('cscRes').innerText = (Math.abs(s) < 1e-15) ? "Undefined" : formatVal(1 / s); document.getElementById('secRes').innerText = (Math.abs(c) < 1e-15) ? "Undefined" : formatVal(1 / c); document.getElementById('cotRes').innerText = (Math.abs(s) < 1e-15) ? "Undefined" : formatVal(1 / t); resultDiv.style.display = "block"; }

Understanding Sine, Cosine, and Tangent

Trigonometry is a branch of mathematics that studies the relationships between the sides and angles of triangles. The most fundamental functions in trigonometry are Sine (sin), Cosine (cos), and Tangent (tan). These functions are primarily used to find unknown lengths or angles in right-angled triangles.

The SOH CAH TOA Mnemonic

To remember the ratios for a right triangle, students often use the "SOH CAH TOA" acronym:

  • SOH: Sine = Opposite / Hypotenuse
  • CAH: Cosine = Adjacent / Hypotenuse
  • TOA: Tangent = Opposite / Adjacent

Reciprocal Trigonometric Functions

Beyond the primary three, there are three reciprocal functions calculated by dividing 1 by the primary function:

  • Cosecant (csc): 1 / sin
  • Secant (sec): 1 / cos
  • Cotangent (cot): 1 / tan

Degrees vs. Radians

Angles can be measured in two main units: Degrees and Radians. While degrees are common in everyday use (a full circle is 360°), radians are the standard unit used in calculus and higher-level physics. To convert degrees to radians, multiply the value by π/180. To convert radians to degrees, multiply by 180/π.

Common Trigonometric Values Example

Angle (Deg) Sin Cos Tan
0 1 0
30° 0.5 0.866 0.577
45° 0.707 0.707 1
60° 0.866 0.5 1.732
90° 1 0 Undefined

How to Use the Calculator

  1. Enter the angle value you wish to calculate in the input field.
  2. Select whether your input is in Degrees or Radians using the dropdown menu.
  3. Click Calculate Results to see the Sin, Cos, Tan, and reciprocal values.
  4. Note: For certain angles like 90° or 270°, some functions (like Tan or Sec) may result in "Undefined" because the denominator of the ratio is zero.

Leave a Comment