I want to solve a following problem. Imagine a collection of massive points. Each point has mass, position, velocity, moment of inertia, orientation and spin. We can calculate its total center of mass, total momentum and total angular momentum. The task is to transform the coordinate system so that all 3 of these parameters is zero. For the center of mass and total momentum it is easy. The problem is with the angular momentum. I need to transform a non-rotating coordinate system into a rotating one. I know the formula for such transformation, however I don't know how to find the neccessary angular velocity vector. The particles may undergo linear and angular accelerations, however we can assume that the total momentum and total angular momentum is conserved. The equation I got involves a double cross product and a derivative of the total moment of inertia. I bet someone already solved it, so if you know any papers or hints, please let me know. The numerical sollution will suffice.