> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.ia7uu-PIB0x/rev.181
 * 
 * authors: 
 *   Stefan

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



// draws a bezier between two points on a circle

float x1, x2, y1, y2, a1, a2, r1, r2;
float xb1, xb2, yb1, yb2;
float xbb1, xbb2, ybb1, ybb2;

void setup() {  // this is run once.   

  background(0);
  size(800, 800); 
  //    smooth();
  stroke(255);
  noFill();

  //pos
  x1=150;
  y1=height/2;
  x2=width/2;
  y2=y1;
  r1=50;
  r2=r1;
  rb1=300;
  rb2=rb1;
  //winkel
  a1=45;
  a2=90;
} 

void draw() {  // this is run repeatedly.  
  /*
//not very elegand, but it works for now.
   noStroke();
   fill(0,30);
   rect(0,0,width,height)
   
   stroke(255);
   noFill();
   */
  background(0);
  stroke(255, 20);

  //a2=mouseX*360/width;

  x1=mouseX;
  y1=mouseY;

  for (a1=0;a1<360;a1+=60) {

    for (a2=0;a2<360;a2+=5) {

      xb1=x1+r1*cos(radians(a1));
      yb1=y1+r1*sin(radians(a1));
      xb2=x2+r2*cos(radians(a2));
      yb2=y2+r2*sin(radians(a2));


      ellipse (x1, y1, 2*r1, 2*r1);
      ellipse (x2, y2, 2*r2, 2*r2);
      //line(x1,y1,xb1,yb1);
      //line(x2,y2,xb2,yb2);

      xbb1=x1+rb1*cos(radians(a1));
      ybb1=y1+rb1*sin(radians(a1));
      xbb2=x2+rb2*cos(radians(a2));
      ybb2=y2+rb2*sin(radians(a2));

      bezier(xb1, yb1, xbb1, ybb1, xbb2, ybb2, xb2, yb2);
    }
  }
  //noLoop();
}