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);  
float x = width/2;  
float y = height/2;  
float n = height/10;  
 
background(#E6FBFF);    
// horizontale lijntjes   
for (float i = 0; i < height/2; i = i + n) {        
  line(0, height/2+i, width, height/2+i); //naar beneden   
  line(0, height/2-i, width, height/2-i); //naar boven 
}      
 
//verticale lijntjes    
for (float i = 0; i < width/2; i = i + n) {        
  line(width/2+i, 0, width/2+i, height); //naar rechts   
  line(width/2-i, 0, width/2-i, height); //naar links  
  //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);