statische schets met de rotate functie

 

 

 

 

 

 

 

statische schets met de rotate functie

 

 

 

 

 

 

 

 

 

 

statische schets met de rotate functie

 

statische schets met rotate();                                        terug naar de inleiding
 
 

//size(960,540); 
fullScreen(); 
float x = width/2; 
float y = height/2; 
float n = height/10; 
background(#E6FBFF);   
//horizontale lijnen  van het ruitjespapier    
for (float i = 0; i < height; i = i + n) {      
  line(0, i, width, i);  
}      
//verticale lijn van het ruitjespapier 
for (float j = 0; j < width; j = j + n) {      
  line(j-width/160, 0, j-width/160, height);  
}   
//assenstelsel 
stroke(255,0,0); 
line(0, height/2, width, height/2); 
line(width/2,0, width/2,height); 
stroke(0); 
 
//----------------------hier komt de tekening--------------// 
 
noFill(); 
ellipse(x,y,n,5*n); 
ellipse(x,y,8*n,n); 
 
pushMatrix(); 
translate(x-3*n, y-3*n); 
rotate(-PI/4); 
arc(0, 0, 2*n, 3*n, radians(180), radians(360)); 
popMatrix(); 
 
pushMatrix(); 
translate(x+3*n, y-3*n); 
rotate(PI/4); 
arc(0, 0, 2*n, 3*n, radians(180), radians(360)); 
popMatrix(); 
 
pushMatrix(); 
translate(x+3*n, y+3*n); 
rotate(-PI/4); 
arc(0, 0, 2*n, 3*n, radians(0), radians(180)); 
popMatrix(); 
 
pushMatrix(); 
translate(x-3*n, y+3*n); 
rotate(PI/4); 
arc(0, 0, 2*n, 3*n, radians(0), radians(180)); 
popMatrix(); 
 
pushMatrix(); 
translate(x,y); 
rotate(PI/4); 
ellipse(0,0,5*n,n); 
popMatrix(); 
 
pushMatrix(); 
translate(x,y); 
rotate(-PI/4); 
ellipse(0,0,5*n,n); 
popMatrix(); 
 
//De draaipunten van de bogen 
strokeWeight(n/8); 
stroke(255,0,0); 
point(x-3*n,y-3*n); 
point(x+3*n,y-3*n); 
point(x+3*n,y+3*n); 
point(x-3*n,y+3*n);