# Solving equation for angle

I'm trying to make a crank for elevating a platform to an angle alpha and came up with this equation:

$$\tan(\alpha) = \frac{r \sin(\theta)}{a - r \cos(\theta)}$$

Does anyone know how to solve the equation for $\theta$? I'm not sure if I got it right by substituting $sin(\theta)$ for $\sqrt{1 - \cos^2 \theta }$. I came up with this quadratic equation:

$$a^2r^2 \tan^2(\alpha) - 2ar\ \tan^2(\alpha)\cos(\theta) + (r^2 - \tan(\alpha)) \cos^2(\theta) = 0.$$

But someone told me that it should be:

$$\theta =\sin^{-1} \left(\frac{a}{r\ \sin(\alpha)} \right)-\alpha$$

It's not clear how that was derived though.

Any thought appreciated.

$$\frac{r}{\sin(\alpha)}=\frac{a}{\sin(\alpha+\theta)}\iff\sin(\alpha+\theta)=\frac{a\sin(\alpha)}{r}$$ Thus$$\alpha+\theta=\arcsin\left(\frac{a\sin(\alpha)}{r}\right)\iff\color{red}{\theta=\arcsin\left(\frac{a\sin(\alpha)}{r}\right)-\alpha}$$
$$\begin{eqnarray*} &tan(\alpha) = \frac{r sin(\theta)}{a - r cos(\theta)} \\ \implies & (a-r\cos\theta) \tan\alpha = r\sin\theta \\ \implies & r (\sin\theta + \tan\alpha \cos\theta )=a \tan\alpha \\ \implies & r (\cos\alpha\sin\theta + \sin\alpha \cos\theta )=a \sin\alpha \\ \implies & r \sin(\theta+\alpha)=a \sin\alpha \\ \implies & \theta = \sin^{-1} ( \frac{a \sin\alpha}{r})-a \end{eqnarray*}$$