How to extract Euler angles from a a point in a plane?

Given a certain coordinate frame, I can compute a new one by applying a set of rotations in a given order (what I call Euler $Z-Y-X$). So I yaw, then pitch then roll.

Now imagine that I want to do exactly the opposite: given two coordinate frames (same origin to simplify), how do I find out roll, pitch and yaw angles that were used to transform from one to the other?

-
Writing the new unit vectors in terms of the old gives you the rotation matrix. The conversion between the rotation matrix and Euler angles is covered here: en.wikipedia.org/wiki/… – Jyotirmoy Bhattacharya Oct 12 '10 at 0:26
How do you write the new unit vectors in terms of the old ones? Is it just arcsines? Does order matter? BTW: Why you didn't reply as an answer? It does sound like one to me. – Padu Merloti Oct 12 '10 at 1:02
I took your "given two coordinate frames" to mean that you could write down new coordinates in terms of old ones. What did you mean? Knowing how only one point is transformed is not enough to recover the rotation. – Jyotirmoy Bhattacharya Oct 12 '10 at 1:30
Oh, ok. Yes, I only know the new system in terms of the old one. Thanks! – Padu Merloti Oct 12 '10 at 2:44
Cmon, go to wikipedia and lookup rotation matrices. There is a link to extract euler angles from a 3x3 rot. matrix. What is your rot. matrix? $E = {\hat{i},\hat{j},\hat{k}}$ where i,j,k are the unit vectors of one coordinate system expressed on the other system. – ja72 Sep 27 '11 at 16:56