Skip to content

Instantly share code, notes, and snippets.

@sasaki-shigeo
Created February 7, 2016 14:00
Show Gist options
  • Save sasaki-shigeo/ed2bddac03b9edb9b0a9 to your computer and use it in GitHub Desktop.
Save sasaki-shigeo/ed2bddac03b9edb9b0a9 to your computer and use it in GitHub Desktop.
A Clock Face in Roman Numerals / ローマ数字の時計の文字盤
size(500, 500);
int font_px = min(width, height) / 16;
float r = min(width, height) / 2 - font_px;
String[] hs = { "XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI" };
PFont font = createFont("Serif", font_px);
textFont(font);
textSize(font_px);
textAlign(CENTER, CENTER);
translate(width / 2, height / 2);
fill(0);
for (int i = 0; i < 12; i++) {
text(hs[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