Chapter 57: Clock Numbers

Clock Numbers in the most detailed, clear, and patient way possible.

Imagine we’re sitting together at a desk, and I’m your favorite teacher who wants you to really understand how the numbers on a clock face are placed, styled, and drawn — not just copy-paste a finished clock.

Today we focus only on the numbers (12, 1, 2, …, 12 or just 12, 3, 6, 9) — the fixed part of the clock face that never moves.

We will explain:

  • Why numbers are placed at specific angles
  • How to calculate exact positions using trigonometry
  • Different styles people use (Arabic vs Roman, all 12 vs only quarters)
  • How to make them look good (size, font, color, alignment)
  • Full working code examples you can run immediately

Clock Numbers – Complete Explanation & Build-Along

1. The single most important mental model

Clock numbers are placed on an invisible circle around the center.

  • The clock is a circle → 360°
  • There are 12 hours → each hour is 30° apart (360 ÷ 12 = 30)
  • In Canvas (and almost every graphics system):
    • 0° is at the right (3 o’clock position)
    • Angles increase clockwise
    • But 12 o’clock is at the top → so we subtract 90° (Math.PI/2) to shift 0° to the top

Key formula you will use forever:

JavaScript

Then position:

JavaScript

2. Two common styles of clock numbers

Style Numbers shown Typical look & feel When to use it
Full 12 numbers 1 through 12 Traditional, classic, easy to read Classic wall clocks, teaching clocks
Quarter numbers only 12, 3, 6, 9 only Modern, minimalist, clean Modern watches, dashboard clocks, UI design

Most digital/minimal designs use only 12, 3, 6, 9 — it looks cleaner and less crowded.

3. Minimal complete example – Full 12 numbers

HTML

What you should see & remember forever:

  • Numbers 1–12 placed exactly on an invisible circle
  • Angle formula: (hour % 12) * 30° – 90° (in radians)
  • – Math.PI / 2 shifts 0° from right → top (12 o’clock)
  • textAlign = ‘center’ + textBaseline = ‘middle’ → numbers perfectly centered on their positions

4. Example 2 – Modern style: Only 12, 3, 6, 9

HTML

Key differences from full 12:

  • Fewer numbers → cleaner, more modern/minimal look
  • Bigger font size → easier to read
  • Same angle math — just fewer positions

5. Bonus: Roman numerals version (XII, III, VI, IX)

JavaScript

6. Your mini homework (try tonight – 15–20 minutes)

  1. Draw a clock face with only 12, 3, 6, 9 in large bold font
  2. Add small dots instead of minute ticks (every 6°)
  3. Change colors: light face + dark numbers (or vice versa)
  4. (Bonus) Try Roman numerals instead of Arabic

Paste your version here when you’re done — I’ll review it like we’re sitting together improving it.

Any part confusing?

  • Why we subtract Math.PI / 2 (90°) from the angle?
  • How to place numbers exactly on the circle (not inside or outside)?
  • Difference between full 12 vs quarter numbers?
  • How to make numbers bigger/bolder without looking crowded?
  • Something else?

Tell me — we’ll zoom in until the clock numbers feel perfect to you.

You just mastered one of the most iconic parts of any analog clock — the face is ready for hands next lesson! 🚀

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *