<s>[INST] Trying to solve a pair of trigonometric simultaneous equations I have a machine that has two shafts which are the inputs and their position is set by 2 servo motors.
Depending on the angle of these two shafts (shaft 1 has an angle designated $Ta$ degrees, shaft 2 has an angle designated $Ba$ degrees) a set of gimbals rotates and tilts an attached plate, which is the output of the machine. ( A mirror for reflecting a light beam.)
I have worked out that the plate position designated by the two angles $Pa$ and $Pb$ are related by the following two equations:
$Cos(Pa) = Cos(Ta) * Cos(Ba)$
$Tan(Pb) = {sin(Ta) \over Tan(Ba)}$
$Tb$ has a range of $0$ to $180$ degrees
$Ta$ has a range of $0.001$ to $90$ degrees
Using these 2 equations I can work out the position of the plate given $Ta$ and $TB$
What I would like to do is solve the 2 equations so I can specify $Pa$ and $Pb$ (the required plate location) and calculate $Ta$ and $Ba$ so I can then set the angle of my 2 input shafts accordingly.
Any help would be greatly appreciated As I am no mathematician and struggling with this.
 [/INST] I'll simplify your notation a bit, using shaft angles $T$ and $B$ (rather than $T_a$ and $B_a$), and plate angles $P$ and $Q$ (rather than $P_a$ and $P_b$). The given equations are
$$\cos P = \cos T \cos B \qquad\qquad
\tan Q = \frac{\sin T}{\tan B} \tag{$\star$}$$
Solving these for $\cos T$ and $\sin T$, we eliminate $T$ via the relation $\cos^2 T + \sin^2 T = 1$:
$$\begin{align}
\left(\frac{\cos P}{\cos B}\right)^2 + \left(\tan Q \tan B\right)^2 = 1 &\quad\to\quad \frac{\cos^2 P}{\cos^2 B} + \frac{\tan^2 Q \sin^2 B}{\cos^2 B} = 1 \\[6pt]
&\quad\to\quad \cos^2 P + \tan^2 Q \sin^2 B = \cos^2 B \\
&\quad\to\quad \cos^2 P + \tan^2 Q (1-\cos^2 B) = \cos^2 B \\
&\quad\to\quad \cos^2 P + \tan^2 Q = \cos^2 B ( 1 + \tan^2 Q) = \frac{\cos^2 B}{ \cos^2 Q }
\end{align}$$
Therefore,
$$\begin{align}
\cos^2 B &= \cos^2 Q \left( \cos^2 P + \tan^2 Q \right) = \cos^2 P \cos^2 Q + \sin^2 Q \\
&= ( 1 - \sin^2 P)\cos^2 Q + \sin^2 Q = \cos^2 Q + \sin^2 Q - \sin^2 P \cos^2 Q \\
&= 1 - \sin^2 P \cos^2 Q \\[6pt]
\sin^2 B &= \sin^2 P \cos^2 Q
\end{align}$$ 
and we can write

$$ \cos B = \pm \sqrt{ 1 - \sin^2 P \cos^2 Q } \qquad\qquad \sin B = |\sin P \cos Q|$$

where the "$\pm$" depends $B$'s quadrant, and the "$|\cdot|$" ensures that that quadrant is I or II. Substituting these into $(\star)$, we can solve for functions of $T$:

$$\begin{align}
\cos T &= \frac{\cos P}{\cos B} = \frac{|\cos P|}{\sqrt{1-\sin^2 P \cos^2 Q}} \\[6pt]
\sin T &= \tan B \tan Q =\frac{|\sin P \cos Q \tan Q|}{\sqrt{1-\sin^2 P \cos^2 Q}} = \frac{|\sin P \sin Q|}{\sqrt{1-\sin^2 P \cos^2 Q}} \\[6pt] \tan T &= \left|\frac{\sin P \sin Q}{ \cos P}\right| = \left| \tan P \sin Q \right|\end{align}$$

where the "$\pm$"s vanish but "$|\cdot|$"s remain, to ensure that $T$ is a first-quadrant angle. In fact, when $\cos T \neq 0$, the relation $\cos P = \cos T \cos B$ tells us that $\cos B$ and $\cos P$ share a sign, which resolves the "$\pm$" ambiguity for $\cos B$. (However, when $\cos T = 0$, we also have $\cos P = 0$. In this case, the "$\pm$" remains for $\cos B$, although the expression simplifies to $\cos B = \pm \sin Q$; likewise, $\sin B = |\cos Q|$.)
This agrees with @Daniel's answer, although the final expressions are perhaps a little cleaner here (and maybe also the derivation).
</s>