Created
May 23, 2020 01:26
-
-
Save ryuchan00/64ba9fae307b8be74dae75053527ea86 to your computer and use it in GitHub Desktop.
簡単なロジックで星を作る
This file contains 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(60, 60); | |
background(255); | |
noStroke(); | |
fill(152, 251, 152); | |
int b; | |
int a[] = {1,4,2,5,3}; | |
beginShape(); | |
for (int i = 0; i < 5; i++) { | |
b = a[i] - 1; | |
float x = 30 * cos(2 * PI * b / 5 + PI / 2) + 30; | |
float y = 30 * sin(2 * PI * b / 5 - PI / 2) + 30; | |
vertex(x, y); | |
} | |
endShape(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment