I have a general line segment with endpoints $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$ referenced to a 3D Cartesian coordinate frame E. I wish to rotate this coordinate fram E to a new coordinate system F such that the new $x$-axis is parallel to this line segment.
Basically, I am looking for three unique Euler angles $(\alpha,\beta,\gamma)$, using the usual $z-y'-z''$ convention, in terms of the coordinates for the two endpoints in the original coordinate frame. Therefore, in the new coordinate frame, I will have three equations to satisfy: 1. $y_1''' = y_2'''$, 2. $z_1''' = z_2'''$, and 3. $(x_2'''- x_1''')^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2$
It's probably easier to think about this logically, then, rather than directly in terms of spinors/quaternions. Here's what you can do: you're rotating the $\hat x$ vector onto the vector $\hat \ell$. This can be done in a two-step process: rotate $\hat x$ onto $\hat \ell$'s projection onto the xy-plane. This puts $\hat \ell$ on the $zx'$ plane, and only one more rotation is required--rotation about $y'$--to line up $\hat x''$ with $\hat \ell$.