Skip to content

Instantly share code, notes, and snippets.

@sasaki-shigeo
Last active February 7, 2016 14:04
Show Gist options
  • Save sasaki-shigeo/a082d441adbc5248fac5 to your computer and use it in GitHub Desktop.
Save sasaki-shigeo/a082d441adbc5248fac5 to your computer and use it in GitHub Desktop.
A Clock Face in Arabic Numerals / 算用数字の時計の文字盤
size(500, 500);
int font_px = min(width, height) / 16;
float r = min(width, height) / 2 - font_px;
textSize(font_px);
textAlign(CENTER, CENTER);
translate(width / 2, height / 2);
fill(0);
for (int i = 1; i <= 12; i++) {
text("" + i, r * cos(radians(30 * i - 90)), r * sin(radians(30 * i - 90)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment