xxxxxxxxxx
23
//modified from:genekogan.com/code/p5js-transformations/
// create a variable to hold angle rotation values
function setup(){
createCanvas(400, 400);
}
function draw(){
background(240);
// update rotation values to pass to rotate
// move the origin to the pivot point
translate();
// then rotate the grid around the pivot point
rotate();
// and draw the square at the origin
fill(0);
rect(0, 0, 100, 100);
}