Mmmm this needs to become a FAQ. Basic rotation goes like this:
x' = x*cos(a) - y*sin(a);
y' = x*sin(a) + y*cos(a);
where a is the angle in radians.
This rotates the point (x,y) around the origin to become (x',y'). To rotate around a different point, first translate the point so that the rotation center is the origin, and then translate back again.
For 3D, you can rotate around the 3 axes by using (x,y), (x,z) or (y,z) as the coordinates in the formula above.