-101-101Unit circlex = cos θy = sin θ θ P 0π/2π3π/22π-101θ (rad) · in a circuit θ = ωtP's height against θsin θcos θ π/2
1from math import *2radians(45)3cos(pi / 4)4sin(pi / 4)5atan2(1, -1)610 * sin(pi / 4)10 VR0.00 V0
Unit circle: the arm turns by θ; P = (cos θ, sin θ)Waves: P's height against θ is sin θ; cos θ leads it by π/2AC circuit: the voltmeter reads 10 · sin θ, with θ = ωtPython card and calculator: math.sin, cos, atan2, radiansLeft: the unit circle. The arm turns counterclockwise by θ from (1, 0) to P; the flat leg under P is cos θ and the upright leg is sin θ. Right: P's height plotted against θ draws the sine wave; cosine is the same wave a quarter turn earlier. On the table: an AC source v(t) = 10 sin(2π·50·t) drives a resistor; the voltmeter reads the arm's height scaled by 10. Tokens hop from the Python card to the calculator. 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.

Angles

  1. 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.

Sine and cosine

Waves

In a circuit

Try it in the Python prompt

;; step 1/10 · Angles in radians
>>> from math import *
>>> radians(45), pi / 4
(0.7853981633974483, 0.7853981633974483)
>>> degrees(1)              # one radian in degrees
57.29577951308232
>>> degrees(2 * pi)
360.0

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 ==.