Skip to content
AI360XpertBeta

Trigonometry

Trigonometry turns angles into numbers you can compute with, so rotations, waves, and repeating patterns become algebra instead of geometry.

In a right triangle the 30 degree angle fixes every side ratio at once: sine one half, cosine root 3 over 2, and tangent 1 over root 3
In a right triangle the 30 degree angle fixes every side ratio at once: sine one half, cosine root 3 over 2, and tangent 1 over root 3

Why Does This Exist?

Learning keeps meeting angles it cannot avoid. Word order becomes rotation in a positional encoding, sound becomes oscillation, an image gets rotated for augmentation, and a robot arm converts a joint angle into a hand position. Staring at the angle tells you nothing computable. Trigonometry is the bridge: it converts each angle into ordinary numbers, ratios of triangle sides, that plug straight into formulas and code.

Without it you would be stuck measuring pictures. With it, a rotation is a multiplication, a wave is a function you can differentiate, and a periodic pattern is something a model can learn. This page covers the core idea: angles fix side ratios, and those ratios are sine, cosine, and tangent. Rotations reuse them through the dot product, waves reuse them through the Fourier transform, and the containers they act on are vectors, matrices and tensors.

The one idea you need first

A ratio is one length divided by another, so it has no units and survives scaling. If a short side is always half the longest side, that one half holds for a sketch and a skyscraper. Trigonometry is the discovery that fixing an angle fixes three such ratios, which is why one small triangle teaches you every triangle with the same angles.

Think of It Like This

A ladder against a wall

Lean a ladder against a wall. The ground angle decides the whole shape: a shallow angle puts the foot far out, a steep angle brings it close. Double the ladder length while a friend holds the angle fixed. The foot distance doubles too, but foot-divided-by-ladder never changes. That unchanging fraction is what trigonometry names.

Sine, cosine, and tangent are three such fractions, written down once so nobody remeasures the ladder. The analogy stops where circles start: ladders only make angles up to 90 degrees, while the full functions keep going around the whole circle, which is where waves come from.

How It Actually Works

Take any right triangle and pick one sharp angle θ\theta (theta). Name the sides relative to it: opposite across from θ\theta, adjacent touching θ\theta but not the hypotenuse, and hypotenuse across from the right angle. The three functions are three divisions:

sin⁡θ=oppositehypotenuse,cos⁡θ=adjacenthypotenuse,tan⁡θ=oppositeadjacent\sin \theta = \frac{\text{opposite}}{\text{hypotenuse}}, \qquad \cos \theta = \frac{\text{adjacent}}{\text{hypotenuse}}, \qquad \tan \theta = \frac{\text{opposite}}{\text{adjacent}}

In plain words: sine is how much of the longest side points across from your angle, cosine is how much points along beside it, and tangent is the slope, rise over run. Every symbol is a length except θ\theta itself, which is the angle. Similar triangles scale all sides together, so these fractions depend on θ\theta alone. Change the angle and the ratios change; keep the angle and no scaling moves them.

Worked example

Use the classic 30-60-90 triangle with hypotenuse 2. Its sides sit in the fixed proportion 1:3:21 : \sqrt{3} : 2, so opposite =1= 1, adjacent =3≈1.732= \sqrt{3} \approx 1.732, hypotenuse =2= 2 for the 30 degree angle:

  • sin⁡30°=1/2=0.5\sin 30° = 1 / 2 = 0.5
  • cos⁡30°=1.732/2≈0.866\cos 30° = 1.732 / 2 \approx 0.866
  • tan⁡30°=1/1.732≈0.577\tan 30° = 1 / 1.732 \approx 0.577

Tie them together: sin⁡2+cos⁡2=0.25+0.75=1.0\sin^2 + \cos^2 = 0.25 + 0.75 = 1.0, exactly as the identity promises. And tan⁡=sin⁡/cos⁡=0.5/0.866≈0.577\tan = \sin / \cos = 0.5 / 0.866 \approx 0.577, consistent. One angle, three numbers, all agreeing.

Code

Compute the three ratios from side lengths and confirm they match the library functions of the angle:

import numpy as np
opp, adj, hyp = 1.0, float(np.sqrt(3)), 2.0theta = np.deg2rad(30)  # 30 degrees as the library expects it, in radians
print(opp / hyp)  # -> 0.5print(np.isclose(opp / hyp, np.sin(theta)))  # -> Trueprint(round(adj / hyp, 4))  # -> 0.866print(round(opp / adj, 4))  # -> 0.5774

Side division and sin agree, which is the whole claim in one line: the angle determines the ratio.

Watch Out For

Feeding degrees to a function that expects radians

You compute sin(30) and get −0.988-0.988 instead of 0.50.5, so you conclude your geometry is broken. It is not. Nearly every library takes radians, and 30 radians is a huge angle spun many times around the circle. The symptom is familiar angles giving wild values. Fix it at the boundary with np.deg2rad before calling, and keep one convention inside each function.

Using the wrong angle of the two

A right triangle has two sharp angles, and opposite and adjacent swap when you switch between them. Reading sides labelled for 30 degrees while using the 60 degree angle gives sin⁡60°=0.866\sin 60° = 0.866 where you expected 0.50.5. Always mark which angle is θ\theta first, then name the sides relative to it. If sine comes out larger than cosine for an angle you believed was small, you are reading the other angle's ratios.

The Quick Version

  • Trigonometry converts each angle into fixed side ratios, so geometry becomes arithmetic.
  • Sine is opposite over hypotenuse, cosine is adjacent over hypotenuse, tangent is opposite over adjacent.
  • The ratios depend on the angle alone; scaling the triangle changes nothing.
  • A 30 degree angle always gives sine one half and cosine about 0.866, at any size.
  • Libraries take radians, not degrees, so convert first or familiar angles give nonsense.
  • These ratios feed rotations, waves, and everything built on angles.