For each type of conversion between rotation views , you have this website Euclidean space .
You will find examples of theory and code:
Axis Angle. R (3x3), (. ):
angle = acos(( R00 + R11 + R22 - 1)/2);
x, y, x:
x = (R21-R12)/sqrt ((R21-R12) ^ 2 + (R02-R20) ^ 2 + (R10-R01) ^ 2);
y = (R02 - R20)/sqrt ((R21 - R12) 2 + (R02 - R20) 2 + (R10 - R01) ^ 2);
z = (R10 - R01)/sqrt ((R21 - R12) 2 + (R02 - R20) 2 + (R10 - R01) ^ 2);