Haig Armen Educational Archive


Exercise 23

by Haig. Average Reading Time: less than a minute.

Continuing our experiments with rotation

Think of the rotate() function like sticking a pin into the top left (0,0) corner of our piece of paper (our canvas) and turning the paper around the pin axis.


float r = 0;

void setup() {
  size(400,400);
  background(10);
  smooth();
  noStroke();
}
void draw() {
  fill(255);
  rotate(r);
  float circle_size = random(5, 15);
  ellipse(100 + r, 10, circle_size, circle_size);
  r = r + 0.2;
  println(r);
}

No comments on ‘Exercise 23’

Leave a Reply