Created
February 7, 2016 14:00
-
-
Save sasaki-shigeo/ed2bddac03b9edb9b0a9 to your computer and use it in GitHub Desktop.
A Clock Face in Roman Numerals / ローマ数字の時計の文字盤
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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