Angles, Degrees, and Radians
Degrees
A full rotation is split into 360 degrees (°). Familiar benchmarks:
- 90° = quarter turn (right angle)
- 180° = half turn (straight line)
- 270° = three-quarter turn
- 360° = full turn
Degrees are convenient for humans (divisible by 2, 3, 4, 6, 9, …), which is why CSS, SVG rotations, and compass bearings use them.
Radians
A radian measures rotation by arc length: one radian is the angle that subtends an arc exactly one radius long. Since a full circle’s circumference is \(2\pi r\):
Key equivalents to memorize:
| Degrees | Radians | Decimal |
|---|---|---|
| 0° | \(0\) | 0 |
| 30° | \(\pi/6\) | ≈ 0.5236 |
| 45° | \(\pi/4\) | ≈ 0.7854 |
| 60° | \(\pi/3\) | ≈ 1.0472 |
| 90° | \(\pi/2\) | ≈ 1.5708 |
| 180° | \(\pi\) | ≈ 3.1416 |
| 270° | \(3\pi/2\) | ≈ 4.7124 |
| 360° | \(2\pi\) | ≈ 6.2832 |
Conversion formulas
In code, never hand-roll \(\pi\) — use the constant:
import math
def deg_to_rad(d): return d * math.pi / 180
def rad_to_deg(r): return r * 180 / math.pi
print(deg_to_rad(180)) # 3.141592653589793
print(rad_to_deg(math.pi / 2)) # 90.0
# Or just use the stdlib:
print(math.radians(45), math.degrees(math.pi / 4))const degToRad = (d) => d * Math.PI / 180;
const radToDeg = (r) => r * 180 / Math.PI;
console.log(degToRad(180)); // 3.141592653589793
console.log(radToDeg(Math.PI / 2)); // 90
Why radians are the default in code
Math.sin / math.sin and friends take radians. Reasons:
- Calculus and series expansions only come out clean in radians (e.g. \(\sin x \approx x\) for small \(x\) holds in radians only).
- Arc-length math becomes trivial: \(\text{arc} = r\theta\), no conversion factor.
- Angular velocity is natural: \(\omega\) radians/second × \(t\) seconds = angle.
The #1 beginner bug is passing degrees into a radian function: Math.sin(90) is not 1 — it is Math.sin(90 radians) ≈ 0.894. Always convert first.
// WRONG: Math.sin(90) ≈ 0.894 (90 radians!)
// RIGHT:
console.log(Math.sin(degToRad(90))); // 1
Coterminal angles and negative angles
Adding or subtracting 360° (\(2\pi\)) gives the same direction. So 30°, 390°, and −330° are coterminal:
Negative angles mean clockwise rotation. Normalize any angle into \([0, 360)\) or \([0, 2\pi)\):
import math
def normalize_deg(d): return d % 360
def normalize_rad(r): return r % (2 * math.pi)
print(normalize_deg(-30)) # 330
print(normalize_deg(390)) # 30Practice
- Convert 60°, 135°, 300° to radians by hand, then check with
math.radians. - Convert \(\pi/3\), \(5\pi/6\), \(3\pi/4\) to degrees.
- Evaluate
math.sin(math.pi)— why is it1.22e-16instead of exactly0? (Hint: floating-point.) - A wheel spins at 2 rad/s. What angle (radians and degrees) has it turned after 3 s?
Next: Right-Triangle Trigonometry — SOH-CAH-TOA.