Everyone's AI
Machine learningAI Papers
Loading...

Learn

🏅My achievements

Chapter 13

Trigonometric Functions: define angle-ratio relations as functions (sin, cos, tan)

Trigonometric functions are like a precise ruler that shows how side-length ratios change as an angle changes. They are essential for expressing periodic phenomena such as clock cycles and seasons. This regularity supports wave motion, signal analysis, and modern AI techniques such as positional encoding.

On the unit circle, rotating by angle θ\thetaθ moves the point as (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta)(cosθ,sinθ).

sin θ: vertical height

θsinθxy

sin(θ) = -0.87

cos θ: horizontal length

θcosθxy

cos(θ) = 0.50

tan θ: slope ratio

θxytanθtanθ = y/x = -1.73

tan(θ) = -1.73

Current at θ:sinθ = -0.87cosθ = 0.50tanθ = -1.73
Core relation: tanθ = sinθ / cosθ (cosθ ≠ 0)

On the unit circle, the horizontal projection is cos⁡θ\cos\thetacosθ, the vertical projection is sin⁡θ\sin\thetasinθ, and the slope ratio is tan⁡θ=sin⁡θcos⁡θ\tan\theta=\frac{\sin\theta}{\cos\theta}tanθ=cosθsinθ​.

  • Create angle θ\thetaθ and locate point PPP on the circle.
  • The x-coordinate of PPP is cos⁡θ\cos\thetacosθ, and the y-coordinate is sin⁡θ\sin\thetasinθ.
  • When cos⁡θ≠0\cos\theta\neq0cosθ=0, read slope using tan⁡θ=sin⁡θ/cos⁡θ\tan\theta=\sin\theta/\cos\thetatanθ=sinθ/cosθ.

What are trigonometric functions?

Concept: In a right triangle, trigonometric functions describe side ratios as functions of angle θ\thetaθ. In formulas: sin⁡θ=heighthypotenuse\sin\theta=\frac{\text{height}}{\text{hypotenuse}}sinθ=hypotenuseheight​, cos⁡θ=basehypotenuse\cos\theta=\frac{\text{base}}{\text{hypotenuse}}cosθ=hypotenusebase​, tan⁡θ=heightbase\tan\theta=\frac{\text{height}}{\text{base}}tanθ=baseheight​.
Intuition (Ferris wheel analogy): On the unit circle (radius 1), after rotating by θ\thetaθ, your position is (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta)(cosθ,sinθ). So cos⁡θ\cos\thetacosθ is horizontal position and sin⁡θ\sin\thetasinθ is vertical position.
Math explanation: The unit-circle equation is x2+y2=1x^2+y^2=1x2+y2=1. Substituting (x,y)=(cos⁡θ,sin⁡θ)(x,y)=(\cos\theta,\sin\theta)(x,y)=(cosθ,sinθ) gives the core identity sin⁡2θ+cos⁡2θ=1\sin^2\theta+\cos^2\theta=1sin2θ+cos2θ=1. Also, slope is rise over run, so tan⁡θ=sin⁡θcos⁡θ\tan\theta=\frac{\sin\theta}{\cos\theta}tanθ=cosθsinθ​.
Practical bridge: Many real datasets are cyclic (day/night, seasons, direction). Instead of feeding raw linear numbers, encode them with trigonometric features so models learn smooth circular structure. For beginners, convert time first using 24 hours = 360 degrees before connecting to θ=2π⋅tT\theta=2\pi\cdot\frac{t}{T}θ=2π⋅Tt​.
It resolves cyclic boundary problems. For example, 23:00 and 00:00 are close in time but far apart as raw numbers. Using sin⁡/cos⁡\sin/\cossin/cos encoding preserves their circular closeness.
It is foundational in Transformer positional encoding, where mixtures of sinusoidal frequencies provide order-aware representations.
It is the core language of wave and frequency modeling, which underpins signal processing and time-series AI.
Convert angle/time to radians, then use paired features (sin⁡θ,cos⁡θ)(\sin\theta,\cos\theta)(sinθ,cosθ) as model input.
Apply trigonometric encoding to cyclic data such as weekdays, seasons, and direction to remove discontinuities.
Cosine similarity also uses the same trigonometric intuition. For vectors a,b\mathbf{a},\mathbf{b}a,b, similarity is cos⁡θ=a⋅b∥a∥∥b∥\cos\theta=\frac{\mathbf{a}\cdot\mathbf{b}}{\|\mathbf{a}\|\|\mathbf{b}\|}cosθ=∥a∥∥b∥a⋅b​, where the key is direction over magnitude. If directions align, cos⁡θ≈1\cos\theta\approx1cosθ≈1; if orthogonal, 000; if opposite, −1-1−1. This is why recommendation systems, embedding search, and RAG retrieval use cosine similarity to find semantically close items even when raw lengths differ.
This set minimizes repeated question types, so identify type first. Solve in order: (1) type identification (coordinate/sign/period/identity/ML encoding) →
(2) choose unit-circle coordinate (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta)(cosθ,sinθ) or formula →
(3) calculate and verify sign.
As in Chapter 04 style reasoning, start from definitions and narrow down step by step. Typical order is easy (coordinate/sign) → medium (period/sums/identity) → hard (ML encoding/composite). For time questions, converting with 24 hours = 360 degrees is safer than starting from raw π\piπ arithmetic.
Example problems and step-by-step solutions:
  • ProblemExample 1 (Easy). On the unit circle, what is the y-coordinate at θ=180∘\theta=180^\circθ=180∘?
  • SolutionPoint is (−1,0)(-1,0)(−1,0), so y-coordinate is 000. Therefore sin⁡θ=0\sin\theta=0sinθ=0.
  • ProblemExample 2 (Medium). What is the period (degrees) of y=cos⁡(6x)y=\cos(6x)y=cos(6x)?
  • SolutionUse 360k\frac{360}{k}k360​ with k=6k=6k=6: 3606=60\frac{360}{6}=606360​=60.
  • ProblemExample 3 (Hard). For hour=18hour=18hour=18, find sin⁡(2π⋅hour/24)\sin(2\pi\cdot hour/24)sin(2π⋅hour/24).
  • Solution24h=360∘24\text{h}=360^\circ24h=360∘, so 18h=270∘18\text{h}=270^\circ18h=270∘, and sin⁡270∘=−1\sin270^\circ=-1sin270∘=−1.
ProblemSolution
Example 1 (Easy). On the unit circle, what is the y-coordinate at θ=180∘\theta=180^\circθ=180∘?Point is (−1,0)(-1,0)(−1,0), so y-coordinate is 000. Therefore sin⁡θ=0\sin\theta=0sinθ=0.
Example 2 (Medium). What is the period (degrees) of y=cos⁡(6x)y=\cos(6x)y=cos(6x)?Use 360k\frac{360}{k}k360​ with k=6k=6k=6: 3606=60\frac{360}{6}=606360​=60.
Example 3 (Hard). For hour=18hour=18hour=18, find sin⁡(2π⋅hour/24)\sin(2\pi\cdot hour/24)sin(2π⋅hour/24).24h=360∘24\text{h}=360^\circ24h=360∘, so 18h=270∘18\text{h}=270^\circ18h=270∘, and sin⁡270∘=−1\sin270^\circ=-1sin270∘=−1.
How to solve by type
  • TypeUnit-circle coordinate
  • DescriptionAsk for x, y, or x+yx+yx+y
  • How to get the answerLocate standard angle, read x=cos⁡θx=\cos\thetax=cosθ, y=sin⁡θy=\sin\thetay=sinθ
  • TypeQuadrant sign
  • DescriptionDetermine + / - of function values
  • How to get the answerCheck signs of x,y by quadrant, then infer sin⁡\sinsin, cos⁡\coscos, tan⁡=yx\tan=\frac{y}{x}tan=xy​
  • TypePeriod calculation
  • Descriptiony=sin⁡(kx),y=cos⁡(kx)y=\sin(kx), y=\cos(kx)y=sin(kx),y=cos(kx)
  • How to get the answerPeriod in degrees is 360k\frac{360}{k}k360​
  • TypeIdentity/composite
  • Descriptionsin⁡2θ+cos⁡2θ\sin^2\theta+\cos^2\thetasin2θ+cos2θ, sums/ratios
  • How to get the answerApply identity, then substitute
  • TypeML application (beginner)
  • DescriptionTime/direction encoding
  • How to get the answerConvert with 24h=360° first, then connect to θ=2π⋅tT\theta=2\pi\cdot\frac{t}{T}θ=2π⋅Tt​
TypeDescriptionHow to get the answer
Unit-circle coordinateAsk for x, y, or x+yx+yx+yLocate standard angle, read x=cos⁡θx=\cos\thetax=cosθ, y=sin⁡θy=\sin\thetay=sinθ
Quadrant signDetermine + / - of function valuesCheck signs of x,y by quadrant, then infer sin⁡\sinsin, cos⁡\coscos, tan⁡=yx\tan=\frac{y}{x}tan=xy​
Period calculationy=sin⁡(kx),y=cos⁡(kx)y=\sin(kx), y=\cos(kx)y=sin(kx),y=cos(kx)Period in degrees is 360k\frac{360}{k}k360​
Identity/compositesin⁡2θ+cos⁡2θ\sin^2\theta+\cos^2\thetasin2θ+cos2θ, sums/ratiosApply identity, then substitute
ML application (beginner)Time/direction encodingConvert with 24h=360° first, then connect to θ=2π⋅tT\theta=2\pi\cdot\frac{t}{T}θ=2π⋅Tt​

Example (Unit-circle coordinate)
At θ=270∘\theta=270^\circθ=270∘, find x+yx+yx+y.
Solution
1) Point at 270∘270^\circ270∘ is (0,−1)(0,-1)(0,−1)
2) x+y=0+(−1)=−1x+y=0+(-1)=-1x+y=0+(−1)=−1
So the answer is -1.

Example (Quadrant sign)
In Quadrant II, what is the sign of tan⁡θ\tan\thetatanθ?
Solution
1) In QII, sin⁡θ>0\sin\theta>0sinθ>0, cos⁡θ<0\cos\theta<0cosθ<0
2) So tan⁡θ=sin⁡θcos⁡θ<0\tan\theta=\frac{\sin\theta}{\cos\theta}<0tanθ=cosθsinθ​<0
So the answer is negative.

Example (Period calculation)
Find the period (degrees) of y=sin⁡(8x)y=\sin(8x)y=sin(8x).
Solution
1) Use period formula 360k\frac{360}{k}k360​
2) With k=8k=8k=8, 3608=45\frac{360}{8}=458360​=45
So the answer is 45.

Example (ML application, without direct π\piπ arithmetic)
For hour=6hour=6hour=6, when a day (24h) is mapped to 360°, what is the angle and sin⁡θ\sin\thetasinθ?
Solution
1) 24h = 360°, so 1h = 15°
2) 6h = 6×15=90∘6\times15=90^\circ6×15=90∘
3) sin⁡90∘=1\sin90^\circ=1sin90∘=1
So the answer is 1.
(Equivalent formula form: θ=2π⋅624=π2\theta=2\pi\cdot\frac{6}{24}=\frac{\pi}{2}θ=2π⋅246​=2π​.)