(x,y,z) and (X,Y,Z) are two unit vectors. Both are perpendicular to a unit vector (u,v,w) and -1 < Y < 1.

Is there any simple method to determine the sign of (theta is angle for rotating X,Y,Z about u,v,w into x,y,z). When I solve the equations for rotating (X,Y,Z) about (u,v,w), i always get possible null-division, so I need two conditional expressions. Couldn't there be a simpler method like the sign of a projection or something like that?