Hello cybernet, try this code, you might wanna hard code the translate arguments & change these two zeros that are inside the rect() into also some hard coded argument, here is my code;
push();
translate(200, 200);
rotate(radians(x-159));
rect(200, 0, 7, 35);
pop();
x = x + 3;