daphne klokje (with help)
float px, py, px1, py1, px2, py2; float angle, angle1, angle2; float radius = 100; float radius1 = 70; float radius2 = 90; float frequency = 7.0; float frequency1 = .01; float frequency2 = .12; PFont myFont; void setup(){ size(600, 200); background (127); myFont = createFont("verdana", 12); textFont(myFont); } void draw(){ background (127); noStroke(); fill(255); ellipse(width/8, 75, radius, radius); //Secondenwijzer px = width/8 + cos(radians(angle))*(radius/2); py = 75 + sin(radians(angle))*(radius/2); angle += frequency; stroke(50); line(width/8, 75, px, py); //============= //Kleine wijzer px1 = width/8 + cos(radians(angle1))*(radius1/2); py1 = 75 + sin(radians(angle1))*(radius1/2); angle1 += frequency1; stroke(50); line(width/8, 75, px1, py1); //============= //Grote wijzer px2 = width/8 + cos(radians(angle2))*(radius2/2); py2 = 75 + sin(radians(angle2))*(radius2/2); angle2 += frequency2; stroke(50); line(width/8, 75, px2, py2); //============= fill(0); text("12", 70, 35); text("3", 115, 75); text("6", 70, 125); text("9", 25, 75); text(" Zoals het klokje thuis tikt, tikt het nergens.",150, 35); text("px = " + px, 105, 185); text("px = " + px2, 215, 185); }
page revision: 1, last edited: 13 Oct 2009 19:30