Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
19
Task/Draw-a-clock/Processing/draw-a-clock-1
Normal file
19
Task/Draw-a-clock/Processing/draw-a-clock-1
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
void draw() {
|
||||
drawClock();
|
||||
}
|
||||
void drawClock() {
|
||||
background(192);
|
||||
translate(width/2, height/2);
|
||||
float s = second() * TWO_PI / 60.0;
|
||||
float m = minute() * TWO_PI / 60.0;
|
||||
float h = hour() * TWO_PI / 12.0;
|
||||
rotate(s);
|
||||
strokeWeight(1);
|
||||
line(0, 0, 0, -width*0.5);
|
||||
rotate(-s+m);
|
||||
strokeWeight(2);
|
||||
line(0, 0, 0, -width*0.4);
|
||||
rotate(-m+h);
|
||||
strokeWeight(4);
|
||||
line(0, 0, 0, -width*0.2);
|
||||
}
|
||||
7
Task/Draw-a-clock/Processing/draw-a-clock-2
Normal file
7
Task/Draw-a-clock/Processing/draw-a-clock-2
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
int lastSec = second();
|
||||
void draw() {
|
||||
if (lastSec!=second()) {
|
||||
drawClock();
|
||||
lastSec=second();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue