# Actuate arbitrary rotation with three axes of motion

I have a rig with the ability to actuate rotation along the azimuth, elevation and polarization axes. I am wanting to compensate for the rig being arbitrarily inclined, which could result in, e.g., an azimuth rotation no longer being satisfied by actuating the "azimuth" motor but instead requiring a combination of all three actuators.

I am able to determine the vectors pointing along the new rotational axes of my actuators but I do not know how I would decompose an arbitrary rotation into rotation about the three new axes.

I am aware of decomposing an arbitrary rotation into X, Y, Z rotations, and I am aware of generating rotation matrices about arbitrary axes by a given angle. My first thought was to construct the matrices generating the rotation of the inclined actuators in the original coordinate system (parametrized by an unknown angle) and equating their product to the arbitrary rotation matrix with the hope of solving for the three unknown angles. This becomes unwieldy.

Another idea would be to express the rotation matrix in a coordinate system which is aligned with the inclined rig (change of basis) and then decomposing this new matrix into X, Y, and Z rotations which would map a little easier to the actuator axes. Could this be a viable approach?

Technically I don't need to emulate arbitrary rotations, only those of azimuth, elevation, and polarization. The simplest of which is the azimuthal rotation, given by a rotation about the Z axis:

$$R_z(\theta) = \begin{bmatrix} \cos{\theta} & - \sin{\theta} & 0 \\ \sin{\theta} & \cos{\theta} & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}.$$

If relevant: the polarization actuator is mounted (dependent) on the elevation actuator, which is in turn mounted on the azimuth actuator.

To summarize:

I want to perform rotations corresponding to changes in azimuth, elevation, and polarization using actuators which have been inclined out of alignment in some arbitrary (known) manner. The desired output of a working algorithm is the angle which each actuator should rotate by to achieve the desired rotation.

Any pointers or references would be greatly appreciated.