Horology: The Physics of Clocks
How do we measure the passage of time? For centuries, humanity relied on mechanical timepieces: intricate systems of springs, cogs, and balance wheels meshing together in synchronous harmony. The study of these mechanisms is called Horology.
Behind every mechanical ticking hand lies a system of Polar-to-Cartesian coordinate mappings and Interlocking Gear Tooth Physics. In this column, we study these mathematical principles and build a Celestial Mechanical Chronograph Suite in p5.js.
The Horology Glossary
- Escape Wheel: The gear in a mechanical watch that releases energy in discrete steps, producing the "tick" sound.
- Gear Ratio: The ratio of the angular velocities of two meshed gears, determined by their tooth count: $N_1/N_2$.
- Sweep Motion: A continuous hand movement where positions are integrated with millisecond precision, mimicking high-frequency escapements.
1. Polar-to-Cartesian Mapping
On a clock face, time is represented as an angle $\theta$. To draw the hands, we must map these angles to Cartesian coordinates $(x, y)$ on our screen:
\(x = R \cdot \cos(\theta)\) \(y = R \cdot \sin(\theta)\)
To calculate the angle for the second hand:
- Ticking (Stepping): $\theta_s = \left(\frac{\text{seconds}}{60}\right) \cdot 2\pi - \frac{\pi}{2}$
- Sweep (Smooth): $\theta_s = \left(\frac{\text{seconds} + \frac{\text{milliseconds}}{1000}}{60}\right) \cdot 2\pi - \frac{\pi}{2}$
Subtracting $\frac{\pi}{2}$ offsets the angle so that zero points vertically upwards (12 o’clock).
2. The Physics of Meshed Gears
Mechanical clocks use interlocking cogs of different sizes to scale down the speed of the motor. When two gears mesh, their teeth must move at the exact same linear speed along the pitch circle. This dictates their angular velocities ($\omega_1, \omega_2$) based on their number of teeth ($N_1, N_2$):
\(v_1 = v_2 \implies \omega_1 \cdot R_1 = \omega_2 \cdot R_2\) \(\omega_2 = -\omega_1 \cdot \left(\frac{N_1}{N_2}\right)\)
The negative sign indicates that the meshed gears rotate in opposite directions. In our Steampunk layout, we simulate this interlocking behavior using three gears (Center, Escape, and Intermediate) rotating at matching mechanical ratios.
Interactive Chronograph Suite
Configure themes, toggle hand motion styles, and slide the speed multiplier to watch the astronomical day/night cycles and gear cogs spin.
Explore the codebase and run standalone project builds via: shubhamkrshandilya/p5js-clock