perfect loops

void draw() {

  translate(width/2, height/2);
  float x = sin(radians(a))*width/3;
  float y = cos(radians(a))*width/3;  
  ellipse(x, y, 5, 5);
  a = a + 2;  
  gif(180, 1);

}

Just have a look on the following line of code. As you can see, i convert the angle inside the sin()- and cos()-functions into radians. But why?

float x = sin(radians(a))*width/3;

I do this because with radians it is more comfortable to get the frameCount ot he perfect loop: a controls abgle, so if i add 2 to a each frame, the perfect loop frameCount is 180. This is perfect for people who work with the gif-format.

results matching ""

    No results matching ""