Solve for $\theta$: $a = b\tan\theta - \frac{c}{\cos\theta}$ This question was initially posted on SO (Link).  I'm not sure the answer given there was correct.  I cannot get the results from those expressions to match my CAD model.
The title pretty much sums it up. How do I solve for theta given the following equation.
$$a = b\tan\theta - \frac{c}{\cos\theta}$$
I am not a student and this is not homework. It's been quite a while since I've done any significant trig and I'm out of time to figure this out.
 A: This is equivalent to 
$$a \cos x - b \sin x = c$$
which is solved by finding $z$ such that
$$\cos z = \frac{a}{\sqrt{a^2+b^2}}$$
$$\sin z = \frac{b}{\sqrt{a^2+b^2}}$$
Then the original equation is reduced to
$$\cos (x+z) = \frac{c}{\sqrt{a^2+b^2}}$$
which is relatively easy to handle.
A: Hint:
$$ \tan(\theta) = \frac{\sin(\theta)}{cos(\theta)}$$
A: Multiply by $\cos(\theta)$ and rearrange the equation to
$$ b \sin(\theta) - a \cos(\theta) = c$$ 
Take $\phi$ so $\cos(\phi) = b/\sqrt{a^2 + b^2}$ and $\sin(\phi) = a/\sqrt{a^2 + b^2}$ (so $\phi = \arcsin\left(a/\sqrt{a^2+b^2}\right)$ if $b \ge 0$ or 
$\pi - \arcsin\left(a/\sqrt{a^2+b^2}\right)$ otherwise), then this says $\sin(\theta - \phi) = c/ \sqrt{a^2 + b^2}$.  We need
$| c | \le \sqrt{a^2 + b^2}$, and if so, $\theta = \phi + \arcsin\left(c/ \sqrt{a^2+b^2}\right)$ and $\phi + \pi - \arcsin\left(c/ \sqrt{a^2 + b^2}\right)$ are solutions.
A: Maybe try this:
$$a = \frac{b\sin\theta}{\cos\theta} - c\frac{c}{\cos\theta} \Rightarrow a\cos\theta = b\sin\theta - c\Rightarrow a\cos\theta +c = b\sin\theta\Rightarrow a^2\cos^2\theta + 2ac\cos\theta + c^2 = b^2(1-\cos^2\theta)\Rightarrow (a^2+b^2)\cos^2\theta +2ac\cos\theta +c^2-b^2 = 0\Rightarrow$$
$$\cos\theta = \frac{-2ac\pm\sqrt{4a^2c^2 -4(a^2+b^2)(c^2-b^2)}}{2(a^2+b^2)}$$
A: Multiplying both sides by $\cos \theta$ and rearranging terms we find $a \cos \theta - b \sin \theta = c$
We can use a well known trick here to get the left hand side in the form of one trigonometric function:
Let $\sin \phi = \frac{a}{\sqrt{a^2 + b^2}}$ and $\cos \phi = \frac{b}{\sqrt{a^2 + b^2}}$
Then we can substitute to find $\sqrt{a^2 + b^2}(\sin \phi \cos \theta - \cos \phi \sin \theta) = \sqrt{a^2 + b^2} \sin(\phi - \theta) = c$
So, provided that $|c| \leq \sqrt{a^2 + b^2}$, we can solve for $\theta$:
$\sin (\theta - \phi) = - \frac{c}{\sqrt{a^2+b^2}}$ (here I also reversed the signs on $\theta$ and $\phi$ by multiplying by $-1$ since I wanted $\theta$ to be positive)
$\theta = \sin^{-1} \left(\frac{-c}{\sqrt{a^2 + b^2}}\right) + \phi$
A: Solving the system of equations:
$$
\begin{cases}
b\tan(\theta)-\frac{c}{\cos(\theta)}=a&\\
\tan^2(\theta)-\frac{1}{\cos^2(\theta)}=-1&
\end{cases}
$$
A: The given equation is equivalent to
$$
b\sin(\theta)-a\cos(\theta)=c.
$$
A: Using $\tan2A=\dfrac{2t}{1-t^2},\cos2A=\dfrac{1-t^2}{1+t^2},$ where $t=\tan A$
we have $a=b\dfrac{2t}{1-t^2}+c\dfrac{1+t^2}{1-t^2},$ where $t=\tan\dfrac\theta2$
rearrange to form a Quadratic Equation in $t=\tan\dfrac\theta2$
