Trigonometry and the unit circle
About this lesson
Sine and cosine are just coordinates of a point turning around a circle of radius 1. Turn an arm by an angle θ, read off where its tip lands, and watch that height trace out a sine wave as the arm keeps turning. Then use the same picture to read an AC voltage, v(t) = 10 sin(2π·50·t), at one instant.
Angles in radians
An angle measures how far you turn. A full turn is 360°, or 2π radians. One radian is the turn whose arc is as long as the radius, about 57.3°. So 180° is π, 90° is π/2 and 45° is π/4.
>>> from math import * >>> radians(45), pi / 4 (0.7853981633974483, 0.7853981633974483) >>> degrees(1) # one radian in degrees 57.29577951308232 >>> degrees(2 * pi) 360.0
Read the lesson step by step
Angles in radians
An angle measures how far you turn. A full turn is 360°, or 2π radians. One radian is the turn whose arc is as long as the radius, about 57.3°. So 180° is π, 90° is π/2 and 45° is π/4.
>>> from math import * >>> radians(45), pi / 4 (0.7853981633974483, 0.7853981633974483) >>> degrees(1) # one radian in degrees 57.29577951308232 >>> degrees(2 * pi) 360.0The unit circle
The unit circle has radius 1 and its centre at the origin (0, 0). Start at the point (1, 0) and turn counterclockwise by θ. Every angle lands on exactly one point P of the circle, and a full turn, 2π, brings you back.
>>> from math import * >>> x, y = cos(pi / 4), sin(pi / 4) >>> hypot(x, y) # distance from the origin 1.0 >>> cos(2 * pi), sin(2 * pi) # a full turn: back to (1, 0) (1.0, -2.4492935982947064e-16)cos and sin are coordinates
Drop a line from P straight down to the x-axis. The flat leg is cos θ, the x coordinate of P. The upright leg is sin θ, its y coordinate. At θ = π/4 the legs are equal: both are √2/2 ≈ 0.707.
>>> from math import * >>> cos(pi / 4) 0.7071067811865476 >>> sin(pi / 4) 0.7071067811865475 >>> sqrt(2) / 2 0.7071067811865476The Pythagorean identity
The two legs and the radius make a right triangle whose long side is 1. Pythagoras says cos²θ + sin²θ = 1² = 1, for every angle θ. At π/4: 0.5 + 0.5 = 1. That is why P always stays on the circle.
>>> from math import * >>> cos(pi / 4)**2 + sin(pi / 4)**2 1.0 >>> cos(2)**2 + sin(2)**2 # any angle works 1.0Signs around the circle
Keep turning. At 3π/4 (135°) P is left of the y-axis, so cos θ ≈ −0.707 while sin θ stays +0.707. At 5π/4 both are negative; at 7π/4 only sin is. The signs tell you which quarter P is in.
>>> from math import * >>> round(cos(3 * pi / 4), 4), round(sin(3 * pi / 4), 4) (-0.7071, 0.7071) >>> round(cos(5 * pi / 4), 4), round(sin(5 * pi / 4), 4) (-0.7071, -0.7071) >>> round(cos(7 * pi / 4), 4), round(sin(7 * pi / 4), 4) (0.7071, -0.7071)From a point to θ
Going back, you know P's coordinates and want θ. The ratio y/x = tan θ cannot tell (−1, 1) from (1, −1): both give −1. atan2(y, x) checks both signs: atan2(1, −1) = 3π/4 ≈ 2.356 rad, which is 135°.
>>> from math import * >>> atan2(1, -1) 2.356194490192345 >>> degrees(atan2(1, -1)) 135.0 >>> atan(1 / -1) # atan undoes tan, but loses the quarter -0.7853981633974483Unroll it: the sine wave
Now let θ grow steadily and plot P's height, sin θ, against θ. One full turn, 0 to 2π, draws one cycle: up to 1 at π/2, back to 0 at π, down to −1 at 3π/2, and back to 0 at 2π.
>>> from math import * >>> [round(sin(k * pi / 2), 3) for k in range(5)] [0.0, 1.0, 0.0, -1.0, -0.0] >>> sin(pi) # tiny, not 0: pi is rounded 1.2246467991473532e-16Cosine: a shifted sine
cos θ draws the same wave, a quarter turn earlier. It starts at its peak, 1, where sine starts at 0, so cos θ = sin(θ + π/2). Engineers say cosine leads sine by 90°, or π/2 radians.
>>> from math import * >>> cos(1.0), sin(1.0 + pi / 2) (0.5403023058681398, 0.5403023058681398) >>> cos(0), sin(pi / 2) (1.0, 1.0)AC voltage is a sine
An AC source makes v(t) = Vm sin(ωt), with peak Vm = 10 V and frequency f = 50 Hz. The angle ωt grows 2π per cycle, so ω = 2π × 50 ≈ 314.16 rad/s. One cycle takes 1/50 s = 20 ms.
>>> from math import * >>> w = 2 * pi * 50 # omega, rad/s >>> w 314.1592653589793 >>> 1 / 50 # period, s 0.02Reading one instant
At t = 2.5 ms the angle is ωt = 314.16 × 0.0025 ≈ π/4. So v = 10 × sin(π/4) ≈ 7.07 V: the 0.707 from the unit circle, scaled by 10. An arm of length Vm turning at ω is a rotating phasor.
>>> from math import * >>> w = 2 * pi * 50 >>> w * 0.0025, pi / 4 (0.7853981633974483, 0.7853981633974483) >>> 10 * sin(w * 0.0025) 7.071067811865475
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01How many radians are in 90°?
A full turn is 360° = 2π radians, so 90° is a quarter of that: 2π / 4 = π/2 ≈ 1.571.
02On the unit circle, the point P for an angle θ is at (0.6, 0.8). What are cos θ and sin θ?
cos θ is P's x coordinate and sin θ its y coordinate. Check: 0.6² + 0.8² = 0.36 + 0.64 = 1, so P is on the circle.
03Cosine leads sine by π/2. Which equation is true for every angle θ?
Cosine is the sine wave a quarter turn (π/2, or 90°) earlier: it reaches each value π/2 sooner. Check at θ = 0: sin(0 + π/2) = 1 = cos 0. sin(θ − π/2) gives −cos θ instead.
04Why does code use atan2(y, x) instead of atan(y / x) to find an angle?
atan (arctangent) undoes tan: it returns the angle whose tangent is a number. But (1, −1) and (−1, 1) both give y / x = −1. atan2 looks at both signs: atan2(1, −1) = 3π/4 but atan2(−1, 1) = −π/4.
05An AC source gives v(t) = 10 sin(2π · 50 · t) volts. What is v at t = 5 ms?
2π · 50 · 0.005 = π/2, and sin(π/2) = 1, so v = 10 V: a quarter of the 20 ms cycle, at the top of the wave.
Glossary
- Radian
- The angle whose arc is as long as the radius, about 57.3°. A full turn is 2π radians; Python's math functions use radians.
- Unit circle
- The circle of radius 1 centred at the origin (0, 0). A point on it at angle θ is (cos θ, sin θ).
- Sine (sin θ)
- The y coordinate (height) of the point at angle θ on the unit circle.
- Cosine (cos θ)
- The x coordinate of the point at angle θ on the unit circle; cos θ = sin(θ + π/2).
- Pythagorean identity
- sin²θ + cos²θ = 1 for every angle, because the point is always at distance 1 from the origin.
- atan2(y, x)
- atan (arctangent) undoes tan; atan2(y, x) returns the angle of the point (x, y), using the signs of both to pick the right quarter.
- Angular frequency (ω)
- How fast the angle of a sine wave grows, in radians per second: ω = 2πf for a frequency f in hertz.
- Phasor
- A complex number holding a sine wave's peak Vm and phase. Picture it as a frozen snapshot of the rotating phasor: the arm of length Vm turning at ω whose height is the voltage.
Notes and sources
- Python's math.sin and math.cos take radians, not degrees. Convert with math.radians(45) and math.degrees(pi). One radian is 180/π ≈ 57.2958°.
- Floating point is close, not exact: sin(pi) gives about 1.2e-16 instead of 0, because pi itself is rounded. Compare results with math.isclose, not ==.
- Values worth knowing: sin 0 = 0, sin(π/6) = 1/2, sin(π/4) = √2/2 ≈ 0.707, sin(π/3) = √3/2 ≈ 0.866, sin(π/2) = 1. Cosine runs the same list backwards.
- tan θ = sin θ / cos θ is the slope of the arm. It is undefined at π/2 and 3π/2, where cos θ = 0.
- Wall sockets use the same shape at a larger size: 230 V mains (IEC 60038) is an RMS (root mean square) value, the steady voltage that would heat a resistor just as much, and the peak of a sine is RMS × √2, so about 325 V at 50 Hz.
- OpenStax, Precalculus 2e, 5.1 Angles
- OpenStax, Precalculus 2e, 5.2 Unit Circle: Sine and Cosine Functions
- OpenStax, Precalculus 2e, 6.1 Graphs of the Sine and Cosine Functions
- MIT OpenCourseWare 18.01SC Single Variable Calculus
- MIT OpenCourseWare 6.002 Circuits and Electronics
- OpenStax, University Physics Volume 2, 15.1 AC Sources
- BIPM, The International System of Units (SI Brochure): the radian
- Python library: math, trigonometric functions and angular conversion
Quiz Unlocks after the last step.