Angles, degrees and radians
Why this matters
An angle measures a turn. People count turns in degrees, 360 to a full circle, but math and code count them in radians, where a full turn is 2π, about 6.28. Mixing the two up is one of the most common bugs in any program that draws, rotates or measures, because the code still runs and gives a wrong answer. In machine learning, the angle between two lists of numbers is how a model tells whether they point the same way, which is the idea behind comparing the meanings of words. This lesson sets up both units, the conversions between them, and the arc a turn sweeps out, so the next two lessons, on sine, cosine and waves, can use radians without a second thought.
- Measure a turn in degrees and in radians, and convert between them
- Read a radian as the angle whose arc is one radius long, and find an arc's length
- Use math.pi, math.radians and math.degrees, and avoid passing degrees where radians are expected
- Read the angle between two arrows as how far apart their directions are, as ML does
The math: measuring a turn
Purpose. Put a number on how far something has turned.
An angle is an amount of turning between two directions. The everyday unit is the degree: a full turn is 360°, a half turn 180°, a quarter turn (a right angle) 90°.
Math uses a second unit, the radian, built from the circle itself. Take a circle of any size and walk along its edge a distance equal to its radius. The angle you've turned through is 1 radian, about 57.3°. A full turn is the whole edge, 2π radii long, so a full turn is 2π radians:
In plain words: half a turn is π radians, about 3.14. Everything else scales from that.