Trigonometry Calculator Hub
Look up sine, cosine, tangent, and their reciprocals (cosecant, secant, cotangent) plus inverse functions arcsin, arccos, arctan and atan2 — with formulas, exact values, domain and range, and links to dedicated calculators that compute live in your browser. All references verified against NIST DLMF and ISO 80000-2.
Reviewed by WuTools Engineering Team · Last updated
What is trigonometry, and what do these functions actually mean?
Trigonometry is the branch of mathematics that connects angles to ratios of side lengths in triangles, and through the unit circle, to the periodic motion that pervades physics, engineering, and signal processing. Six functions — sine (sin), cosine (cos), tangent (tan), cosecant (csc), secant (sec), and cotangent (cot) — describe a single angle in six related ways. Their inverse functions — arcsine (asin), arccosine (acos), arctangent (atan), and the two-argument atan2 — go the other way: given a ratio, they recover the angle.
The cleanest way to define them is the unit circle: a circle of radius 1 centered at the origin. For an angle θ measured counter-clockwise from the positive x-axis, the point where the angle's terminal ray meets the circle has coordinates (cos θ, sin θ). Tangent is the ratio sin θ / cos θ, equivalent to the slope of that terminal ray. The reciprocal trio (csc, sec, cot) are simply 1/sin, 1/cos, 1/tan. This definition extends naturally beyond right-triangle ratios to all real angles, including negative and obtuse values.
A working programmer encountering JavaScript's Math.sin, Math.cos, and Math.tan needs to remember one detail above all others: they expect angles in radians, not degrees. There are 2π radians in a full circle, so 180° = π radians and 1° = π/180 ≈ 0.01745329 radians. Forgetting this conversion is the single most common bug in trig code. Most engineering calculators include a degree/radian toggle for the same reason.
The six trigonometric functions, explained
Sine (sin) — the vertical coordinate on the unit circle
Defined as the opposite side over the hypotenuse in a right triangle, or equivalently the y-coordinate of the unit-circle point at angle θ. Domain: all real numbers. Range: [−1, 1]. Period 2π. Key values: sin(0) = 0, sin(30°) = 1/2, sin(45°) = √2/2 ≈ 0.7071, sin(60°) = √3/2 ≈ 0.8660, sin(90°) = 1. Sine is an odd function: sin(−θ) = −sin(θ). It models any quantity that oscillates symmetrically about zero — pendulums, AC voltage, sound pressure, water waves.
Cosine (cos) — the horizontal coordinate on the unit circle
Defined as adjacent over hypotenuse, or the x-coordinate on the unit circle. Domain: all reals. Range: [−1, 1]. Period 2π. Key values: cos(0°) = 1, cos(30°) = √3/2, cos(45°) = √2/2, cos(60°) = 1/2, cos(90°) = 0. Cosine is even: cos(−θ) = cos(θ). It is a 90° phase-shifted sine — cos(θ) = sin(θ + π/2) — which is why sine and cosine appear together in nearly every wave equation, Fourier transform, and rotation matrix.
Tangent (tan) — slope of the terminal ray
Defined as sin θ / cos θ, or as the slope of the line from the origin through the unit-circle point at angle θ. Domain: all reals except π/2 + kπ (where cosine is zero). Range: all real numbers. Period π — half that of sine and cosine. Key values: tan(0°) = 0, tan(30°) = 1/√3 ≈ 0.5774, tan(45°) = 1, tan(60°) = √3 ≈ 1.7321. As θ approaches 90° from below, tan grows without bound; tan(90°) is undefined. Tangent is the natural choice for slope, gradient, and field-of-view problems.
Cosecant (csc) — reciprocal of sine
csc θ = 1 / sin θ. Domain excludes 0, ±π, ±2π… Range: (−∞, −1] ∪ [1, +∞). Period 2π. Key values: csc(30°) = 2, csc(45°) = √2 ≈ 1.4142, csc(60°) = 2/√3 ≈ 1.1547, csc(90°) = 1. Cosecant is rarely used in modern computation because 1 / Math.sin(x) is just as fast and clearer. It survives in classical calculus identities (the integral ∫ csc x dx, for instance) and in optics, where it appears in Snell's law derivations.
Secant (sec) — reciprocal of cosine
sec θ = 1 / cos θ. Domain excludes π/2 + kπ. Range: (−∞, −1] ∪ [1, +∞). Period 2π. Key values: sec(0°) = 1, sec(30°) = 2/√3, sec(45°) = √2, sec(60°) = 2. Useful in trigonometric integrals (the antiderivative of sec² x is tan x) and in surveying formulas that relate slant distance to horizontal distance up a slope.
Cotangent (cot) — reciprocal of tangent
cot θ = cos θ / sin θ = 1 / tan θ. Domain excludes 0, ±π, ±2π… Range: all real numbers. Period π. Key values: cot(30°) = √3, cot(45°) = 1, cot(60°) = 1/√3, cot(90°) = 0. Cotangent appears in fluid dynamics (the Manning equation expresses channel slope in terms of cot), in network impedance matching, and in the surveying formulas for grade and gradient where engineers prefer rise-over-run.
Inverse functions: arcsin, arccos, arctan, and atan2
Inverse functions answer the question "which angle has this sine/cosine/tangent?". Because trig functions are periodic, each inverse must be restricted to a principal branch: asin returns an angle in [−π/2, π/2], acos in [0, π], atan in (−π/2, π/2). Their domains: asin and acos accept inputs in [−1, 1]; atan accepts any real. atan2(y, x) is a special two-argument inverse that uses the signs of both x and y to return an angle in the full range (−π, π], correctly handling all four quadrants and the case x = 0. It is the standard choice in graphics, robotics, and navigation.
Common values table — exact algebraic forms
Memorising five rows covers most exam questions and code constants: 0° → sin 0, cos 1, tan 0; 30° (π/6) → sin 1/2, cos √3/2, tan 1/√3; 45° (π/4) → sin √2/2, cos √2/2, tan 1; 60° (π/3) → sin √3/2, cos 1/2, tan √3; 90° (π/2) → sin 1, cos 0, tan undefined. Notice the symmetry: sin and cos values mirror each other across 45°, because sin(θ) = cos(90° − θ). This is the cofunction identity, and it is where the prefix "co-" in cosine, cotangent, and cosecant comes from.
Where trigonometry shows up in real work
- Architecture and roof slope: A pitched roof rising 4 m over a 6 m horizontal run has slope angle atan(4/6) ≈ 33.7°. Roofers in metric countries spec a 1-in-X gradient (cot of the angle); building codes typically require ≥15° on shingle roofs and ≥3° on flat-roof drainage.
- Electrical engineering — AC waveforms: Mains voltage in Europe is V(t) = 325·sin(2π·50·t) — a 50 Hz sine wave with peak 325 V (RMS 230 V). North America runs the same equation at 60 Hz with peak 170 V (RMS 120 V). Reactance, power factor, and three-phase analysis are all phase angles measured in degrees or radians.
- Navigation and bearings: GPS courses are quoted in degrees from north (0°–360°). To compute the change in latitude/longitude after travelling distance d at bearing β, you use Δlat = d·cos(β) and Δlon = d·sin(β)/cos(lat). The haversine formula uses sin² and cos for great-circle distance.
- Signal processing — Fourier and FFT: Any periodic signal can be decomposed into a sum of sin and cos components at integer multiples of the fundamental frequency. The Fast Fourier Transform (FFT) is how MP3, JPEG, Wi-Fi, and 5G compress data; every modern audio plug-in calls Math.sin and Math.cos millions of times per second.
- Astronomy — parallax and stellar distance: A star's distance in parsecs equals 1 / tan(parallax angle in arcseconds). Trig identities also drive coordinate transforms between equatorial, ecliptic, and galactic frames.
- Game development and 3D rotation: Rotating a sprite by angle θ uses x' = x·cos(θ) − y·sin(θ), y' = x·sin(θ) + y·cos(θ). Game engines call
Math.sinandMath.cosin every animation frame; modern code precomputes a sin table or uses quaternion rotations to avoid the cost. - Physics — projectile motion and waves: A projectile launched at velocity v and angle θ has range v²·sin(2θ)/g. Maximum range is at θ = 45°. Snell's law (n₁·sin θ₁ = n₂·sin θ₂) governs every lens, every fiber, every prism.
Trigonometric functions at a glance
| Function | Computed at |
|---|---|
| 1 sin (Sine) | 1 Pa |
| 1 cos (Cosine) | 1 Pa |
| 1 tan (Tangent) | 1 Pa |
| 1 csc (Cosecant) | 1 Pa |
| 1 sec (Secant) | 1 Pa |
| 1 cot (Cotangent) | 1 Pa |
| 1 asin (Arcsine) | 1 Pa |
| 1 acos (Arccosine) | 1 Pa |
| 1 atan (Arctangent) | 1 Pa |
| 1 atan2 (Two-argument arctangent) | 1 Pa |
Frequently asked questions about trigonometry
What's the difference between sin and arcsin?
sin takes an angle and returns a ratio in [−1, 1]: sin(30°) = 0.5. arcsin (also written asin or sin⁻¹) goes the other way: asin(0.5) = 30°. They are inverse operations, but because sine is periodic, arcsin only returns angles in the principal range [−90°, 90°] (or [−π/2, π/2] in radians). To get back any other valid angle, you add 180° or use the cofunction identity.
Why do calculators give different answers in degrees vs radians?
Because they're computing the same function on different inputs. sin(90) in degree mode = 1 (the angle is 90°). sin(90) in radian mode ≈ 0.894 (the angle is 90 radians ≈ 5156°). JavaScript's Math.sin always uses radians; degrees-only languages like spreadsheets default to degrees. Always check the mode indicator before trusting a result. The conversion is rad = deg × π/180.
What does csc/sec/cot mean and when do I need them?
They are reciprocals: csc = 1/sin, sec = 1/cos, cot = 1/tan. In day-to-day calculation you'll almost never need them — 1/Math.sin(x) works fine. They survive because trigonometric integrals and certain identity manipulations are tidier in their language. If a textbook integrates ∫ sec(x)·tan(x) dx = sec(x), the reciprocal forms are what makes the pattern clean.
What is sin(30°) exactly? cos(60°)?
Both equal exactly 1/2. Specifically: sin(30°) = sin(π/6) = 1/2, and cos(60°) = cos(π/3) = 1/2. The two are equal because of the cofunction identity sin(θ) = cos(90° − θ). Other exact values worth memorising: sin(45°) = cos(45°) = √2/2 ≈ 0.7071, sin(60°) = cos(30°) = √3/2 ≈ 0.8660, tan(45°) = 1.
How do I solve a right triangle?
Given any two sides or one side and one acute angle, you can find everything else. Use the mnemonic SOH-CAH-TOA: Sin = Opposite/Hypotenuse, Cos = Adjacent/Hypotenuse, Tan = Opposite/Adjacent. Example: a 3-4-5 right triangle has the angle opposite side 3 equal to asin(3/5) ≈ 36.87°. Then use the Pythagorean theorem (a² + b² = c²) to verify side lengths and angle sum (90° + α + β = 180°) to find the third angle.
Why is tan(90°) undefined?
Because tan = sin/cos, and cos(90°) = 0. Division by zero is undefined. As θ approaches 90° from below, tan(θ) grows without bound (a vertical asymptote). Numerically, JavaScript's Math.tan(Math.PI/2) returns about 1.633e+16 — a very large finite number, not Infinity, because π/2 cannot be represented exactly in IEEE 754 floating point. Treat any result above ~1e15 as effectively infinity.
What is atan2 and why does it differ from atan?
atan(y/x) takes a single ratio and returns an angle in (−90°, 90°) — but it cannot tell whether the original (x, y) was in quadrant I or III, since both produce the same ratio. atan2(y, x) takes both coordinates and uses their signs to return the correct angle in the full (−180°, 180°] range, including the case x = 0. It is the right choice for vector angles, GPS bearings, and any code that needs a unique angle from a 2D point.
How accurate are JavaScript trig functions?
JavaScript's Math.sin, Math.cos, Math.tan use IEEE 754 double-precision floats — about 15–17 significant decimal digits. For most applications this is overkill. The main pitfall is argument reduction: Math.sin(1e15) may have noticeable error because the input has lost precision before the sine is even computed. For values near multiples of π (e.g., sin(π) returning 1.2e-16 instead of 0), expect ULP-level rounding error — that is normal.
Why do trig functions appear in physics formulas?
Anything that rotates, oscillates, or wraps around appears as sin/cos. A pendulum's position is A·cos(ωt). An electron orbiting a nucleus is described by spherical harmonics built from sines and cosines. Quantum wavefunctions, Maxwell's equations, Schrödinger's equation, and even relativity's Lorentz transforms all contain trig (or its hyperbolic cousins). The deep reason: solutions to second-order linear differential equations like ẍ + ω²x = 0 are exactly sines and cosines.
Where can I learn trigonometry from scratch?
Khan Academy's free trigonometry course covers everything from right triangles through identities. MIT OpenCourseWare (18.01 Single Variable Calculus) has rigorous lectures with proofs. For interactive practice, Brilliant.org and Desmos's graphing calculator help build intuition for what sin and cos look like. The NIST Digital Library of Mathematical Functions (dlmf.nist.gov/4) is the authoritative reference for definitions, identities, and series expansions when you need to verify a formula.
