# Finding rotation matrix from angles between plane intersections and axes

I have a proper rotation transformation between coordinate axes $\{X, Y, Z\}$ and $\{X^\prime, Y^\prime, Z^\prime\}$. What I am given are three angles, all of which have vertex at the origin:

Let the line of intersection between the $XY$ plane and the $X^\prime, Y^\prime$ plane be OA; then I am given that the angle between the $X$ axis and OA is $\alpha$.

Let the line of intersection between the $YZ$ plane and the $Y^\prime, Z^\prime$ plane be OB; then I am given that the angle between the $Y$ axis and OB is $\beta$.

Let the line of intersection between the $ZX$ plane and the $Z^\prime, X^\prime$ plane be OC; then I am given that the angle between the $Z$ axis and OC is $\kappa$.

I need to find either the rotation matrix, or the expression of the rotation in terms of Euler angles or in terms of Tait-Bryan angles, as a function of $(\alpha, \beta, \kappa)$.

The three quantities should be sufficient to specify the rotation but I'm having a lot of trouble finding an expression that is not horribly ugly.