Circular Name Badge¶
By the end of this lab you'll be able to:
- Arrange text characters in a circle by placing each at a computed angular position
- Use
setheading()to make each character face outward from the center - Combine circular text with inner decorations to create a complete badge design
A circular badge with a name arranged around the perimeter, two decorative rings, and a filled circle in the center. The characters face outward to be readable from outside the circle.
Welcome to the Circular Badge!
Circular text appears on coins, stamps, and official seals.
In this lab you'll compute the position and rotation of each letter yourself!
Let's code it together!
How It Works¶
For n characters equally spaced around a circle of radius r, character i is placed at angle i * 360 / n degrees. setheading(angle + 90) makes the turtle face outward (90° = up = radially outward when angle=0).
Sample Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
What Do You Think Will Happen?
Each character is rotated to face outward. Will the name be readable around the circle,
or will some letters be upside down at the bottom?
Make your guess — then click Run to find out!
Try It Now¶
Letters at the top are readable, but the bottom letters are upside-down — because the turtle faces outward, letters at the bottom face inward. Were you right?
How It Works¶
The turtle always faces "outward" from the center. For letters at the top (12 o'clock position), "outward" is up — and text reads correctly. For letters at the bottom (6 o'clock), "outward" is down — text appears upside down. Real circular typesetting adjusts for this by flipping the bottom half.
Explanation Table¶
| Line | What it does |
|---|---|
angle_deg = 90 - i * 360 / n |
Start at top (90°), go clockwise |
setheading(-angle_deg + 90) |
Face outward from center |
align='center' |
Center each character on its position |
monty.dot(60, 'navy') |
Filled circle in the center |
Learning Check¶
Your Turn — Change the Name
Change name = "PYTHON PROGRAMMER" to your own name repeated to fill the circle.
Try padding it with spaces or asterisks to fill the ring evenly.
The asterisks act as separators between repeated text, just like on real coins!
Experiments¶
-
Flip the bottom half. For characters where
angle_deg < -90 or angle_deg > 270, add 180° to the heading. You'll know it worked when all characters are readable. -
Use a different font size. Change the font size and adjust
raccordingly. You'll know it worked when larger or smaller letters appear around the ring. -
Add a star decoration. After the circle, draw a 5-pointed star inside the center dot. You'll know it worked when a star appears in the middle.
-
Make a planet badge. Use concentric circles at different radii and put the planet's name around the outer ring. You'll know it worked when it looks like a planet seal.
Your Badge Is Ready!
You computed circular text placement using angles and goto() — the same math
used in coin minting and official seal design!
Up next: Block Letters — drawing large outlined letters from line segments.