> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://bard117f12.sketchpad.cc/sp/pad/view/ro.667LPt4pFbp/rev.2
 * 
 * authors: 
 *   
 *   David Bull
 *   Sam Taffel

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



//Sam Taffel 
//10 - 26 - 12 
//This project, for me, was immensely difficult. For the longest time I had no 
//real idea wich approach was the right one to take. The idea of issuing sin 
//and cosin set me back. Finally though, I was able to break down each section 
//and understand the role of the hands and how mapping played into their
//positioning. This difficulty to master the processing language is apparent 
//in the simplicity of the piece. The only flourish is that with each new minute
//the background shifts from black to white, an obvious though playful nod to 
//a day in a minute. This was, to me, a visually interesting decision to make; 
//whether this intrigues the participant is up for debate. 




void setup() { 
  size(400, 400); 
  smooth(); 
  background(24);
} 

void draw() { 
  background(map(second(), 0, 60, 0, 255)); 
  int x = width/2; 
  int y = height/2; 
  float angle = map(radians(second()), 0, 60, 0, 360) + radians(-90);
  float angle2 = map(radians(minute()), 0, 60, 0, 360) + radians(-90);
  float angle3 = map(radians(hour()), 0, 12, 0, 360) + radians(-90); 
  ellipse(x, y, 200, 200); 
  fill(0, 0, 0); 
  text("12", 193, 120); 
  text("6", 195, 290); 
  text("3", 285, 205); 
  text("9", 108, 205); 
  fill(255, 255, 0); 

  //seconds hand
  strokeWeight(1); 
  float x2 = width/2 + 60*cos(angle); 
  float y2 = height/2 + 60*sin(angle); 
  line(x2, y2, 200, 200);

  //minute hand
  strokeWeight(2); 
  float x3 = width/2 + 60*cos(angle2);
  float y4 = height/2 + 60*sin(angle2); 
  line(x3, y4, 200, 200); 

  
  //hour hand 
  strokeWeight(4); 
  float x5 = width/2 + 60*cos(angle3);
  float y6 = height/2 + 60*sin(angle3); 
  line(x5, y6, 200, 200);
  
}