Solving $a \sin\theta + b \cos\theta = c$ Could someone help me with the steps for solving the below equation $$a \sin\theta + b \cos\theta = c$$
I know that the solution is $$\theta = \tan^{-1} \frac{c}{^+_-\sqrt{a^2 + b^2 - c^2}} - \tan^{-1} \frac{a}{b} $$
I just can't figure out the right steps to arrive at this solution.

here is a trick:
write
$$\frac{a}{\sqrt{a^2+b^2}}\sin(\theta)+\frac{b}{\sqrt{a^2+b^2}}\cos(\theta)=\frac{c}{\sqrt{a^2+b^2}}$$
Setting $$\cos(\phi)=\frac{a}{\sqrt{a^2+b^2}}$$ and $$\sin(\phi)=\frac{b}{\sqrt{a^2+b^2}}$$ then you will get
$$\sin(\phi+\theta)=\frac{c}{\sqrt{a^2+b^2}}$$
so $$\theta=\arcsin\left(\frac{c}{\sqrt{a^2+b^2}}\right)-\phi$$
