float rayon_sec = 0.0; float rayon_sec2 = 4.0; float rayon_min = 0.0; float rayon_min2 = 0.0; float rayon_heu = 0.0; float rayon_heu2 = 0.0; int degre_sec = 0; int degre_sec2 = 6; int degre_min = 0; int degre_min2 = 0; int degre_heu = 0; int degre_heu2 = 0; float angle_sec, angle_sec2, angle_min, angle_min2, angle_heu, angle_heu2; float x_sec, y_sec, x_sec2, y_sec2, x_min, y_min, x_min2, y_min2, x_heu, y_heu, x_heu2, y_heu2; int seconde = 0; int minut = 0; int heure = 0; void setup(){ frameRate(60); size(600,600); background(0); smooth(); } void draw(){ seconde += 1; if (seconde >= 60){ seconde = 0; } //definit les secondes angle_sec = radians (degre_sec); x_sec = 5 * width/8 + (sin(angle_sec) * rayon_sec); y_sec = 5 * height/8 - (cos(angle_sec) * rayon_sec); noStroke(); fill(255); ellipse(x_sec, y_sec, 4, 4); degre_sec += 6; rayon_sec += 4.0; if (rayon_sec >= 240.0){ rayon_sec = 0.0; degre_sec = 0; degre_min += 6; rayon_min += 5.0; } //definit le cache des secondes angle_sec2 = radians (degre_sec2); x_sec2 = 5 * width/8 + (sin(angle_sec2) * rayon_sec2); y_sec2 = 5 * height/8 - (cos(angle_sec2) * rayon_sec2); stroke (0); fill(0); ellipse(x_sec2, y_sec2, 4, 4); degre_sec2 += 6; rayon_sec2 += 4.0; if (rayon_sec2 >= 240.0){ rayon_sec2 = 0.0; degre_sec2 = 0; minut += 1; degre_min2 += 6; rayon_min2 += 5.0; } //definit les minutes angle_min = radians (degre_min); x_min = 5 * width/8 + (sin(angle_min) * rayon_min) - 10; y_min = 5 * height/8 - (cos(angle_min) * rayon_min) - 10; noStroke (); fill(255); ellipse(x_min, y_min, 5, 5); if (rayon_min >= 300.0){ rayon_min = 0.0; degre_min = 0; degre_heu += 15; rayon_heu += 15.0; } //definit le cache des minutes angle_min2 = radians (degre_min2); x_min2 = 5 * width/8 + (sin(angle_min2) * rayon_min2) - 10; y_min2 = 5 * height/8 - (cos(angle_min2) * rayon_min2) - 10; stroke (0); fill(0); ellipse(x_min2, y_min2, 5, 5); if (rayon_min2 >= 300.0){ rayon_min2 = 0.0; degre_min2 = 0; degre_heu2 += 15; rayon_heu2 += 15.0; minut = 0; heure += 1; } //definit les heures angle_heu = radians (degre_heu); x_heu = 5 * width/8 + (sin(angle_heu) * rayon_heu) - 20; y_heu = 5 * height/8 - (cos(angle_heu) * rayon_heu) - 20; noStroke (); fill(255); ellipse(x_heu, y_heu, 6, 6); if (rayon_heu >= 360.0){ rayon_heu = 0.0; degre_heu = 0; } //definit le cache des heures angle_heu2 = radians (degre_heu2); x_heu2 = 5 * width/8 + (sin(angle_heu2) * rayon_heu2) - 20; y_heu2 = 5 * height/8 - (cos(angle_heu2) * rayon_heu2) - 20; stroke (0); fill(0); ellipse(x_heu2, y_heu2, 6, 6); if (rayon_heu2 >= 360.0){ rayon_heu2 = 0.0; degre_heu2 = 0; } if (heure >= 24){ heure = 0; } }