for a really long time, i tried to get a program that did rotation to work and found this difficult as nearly all of the info provided on the subject assume knowledge of matrices. thus, here are the formulas for rotation in simple algebra in cartesian coordinate space:

x axis:
y' = y * cos(a) - z * sin(a)
z' = z * cos(a) + y * sin(a)

y axis:
z' = z * cos(a) - x * sin(a)
x' = x * cos(a) + z * sin(a)

z axis:
x' = x * cos(a) - y * sin(a)
y' = y * cos(a) + x * sin(a)

remember that if you are using these formulas as part of a programming exercise, z' is NOT the same as z so if you say something like:

z' = z * cos(a) - x * sin(a)
x' = x * cos(a) + z' * sin(a)

you will wind up with really wacked out results.