Getting angles for rotating $3$D vector to point in direction of another $3$D vector I've been trying to solve this in Mathematica for $2$ hours, but got the wrong result.
I have a vector, in my case $\{0, 0, -1\}$. I want a function that, given a different vector, gives me angles DX and DY, so if I rotate the original vector by an angle of DX around the X axis, and then rotate it by an angle of DY around the Y axis, I'll get a vector with the same direction as the given vector.
(I want this so I could input angles to SolidWorks to rotate a part so it will satisfy a constraint I defined in Mathematica.)

Okay, if you don't mind rotating about the y and z axes, we can do it like this. Let's take a typical vector like (6,3,2) so the overall length is 7. You want to rotate a vector from the z axis into this orientation. First you look at the angle whose cosine is 2/7...that's how far down you have to come from the z axis. So you rotate about the y axis by that amount. Now you just have to swing around the z axis by the angle whose tangent is 3/6.
I think that's all you need to line up your vectors.
