# Is there a formula to know the angle of an object, on a Cartesian plane, when it is rotated by arbitrary x, y, z degrees?

Example: If I have a line rotated (at its center) by -45 degress on the x, y, and z axis what formula would I used to determine what angle that object is at if you put it back on a cartesian plane?

The higher level version is css transforms. Rotating is made easy but to handle mouse drag events I need to know what direction (on a cartesian plane) the object is pointing.

-
Have you heard of polar coordinates? –  Jebruho Dec 26 '12 at 1:09
Yeah I've heard of them. I intend to relearn the math for this because of the new avenues being opened up for web developers. But right now I'm just hoping for a magic formula that accepts x, y, z and spits out an angle. –  user875234 Dec 26 '12 at 1:15
Note that rotation in 3D is not commutative. That is, rotating about $x$ then $y$ then $z$ is not the same as say rotating about $z$ then $y$ then $x$, or rotating in any other order. (This is why CSS transforms don't allow you to directly specify angles for $x$, $y$ and $z$ in a single rotate3d command; that would be meaningless.) What you are asking for is ambiguous unless you specify the order in which these rotations are performed. –  Rahul Dec 26 '12 at 4:15