Mythmon has pretty much explained it, but I'll try anyway:
When you draw things to the stage they are passed through the transformation matrix to be positioned. The default is 0,0 in the top left corner, with a rotation of 0.
Rotation functions apply to the transformation matrix, so rotating by 45o swing the whole x,y coordinates around by 45o.
If you want to rotate an image, then position it, you need to draw it with a centre of 0,0 and then shift it to its new position.
However, if you then want to draw a second image and move it around you have to reset the transformation matrix, otherwise you'd be drawing relative from the last position/rotation of the matrix.
An easy way round this is to use pushMatrix(), popMatrix().
By calling pushMatrix(); you specify a coordinate system to return to when popMatrix(); is called. Essentially rolling back any transforms applied between the two methods.
In the example below, I've transformed a few rectangles and positioned them around the screen. Drawing rectangles works just the same as drawing PImages and other elements.
(http://mkv25.net/applets/transform/)
Code:
// Set up scene
size(200, 200);
// Set draw mode for rectangles
rectMode(CENTER);
// Draw red rectangle
fill(255, 0, 0);
rect(20, 20, 40, 40);
pushMatrix();
// Draw blue rectangle
rotate(radians(15));
fill(0, 0, 255);
rect(20, 20, 40, 40);
// Draw green rectangle
rotate(radians(15));
fill(0, 200, 0);
rect(20, 20, 40, 40);
popMatrix();
// Draw white rectangle in center
pushMatrix();
translate(width/2, height/2);
rotate(radians(45));
fill(255);
rect(0, 0, 40, 40);
popMatrix();
// Draw small black rectangle in center
fill(0);
rect(width/2, height/2, 20, 20);