The rotation is cleanly represented by for example a quaternion or a 3x3
rotation matrix, not as you suggest by roll, yaw and pitch (also known
as Euler angles). The reason is that Euler angles are not clean is that
it can possibly suffer from an effect that is called the Gimbal lock. If
you need Euler angles anyway (as i did) you can calculate the Euler
angles from a matrix with the code found on this site:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToEuler/index.htmKeep in mind that the order of the Euler angles is important for the
calculation, and for where the gimbal lock exactly occurs