# Do I have to solve a 4th degree equation to find $\cos\alpha$ from $d + t \cos(\alpha) = w \tan(\alpha)$?

I have the following situation:

I know $$w$$, $$d$$ and $$t$$. What I want to know is $$\alpha$$ respectively $$\cos(\alpha)$$.

I have to solve the following formula for $$\alpha$$:

$$d + t \cos(\alpha) = w \tan(\alpha)$$

respectively

$$d + t \cos(\alpha) = w \frac{\sqrt{1 - \cos(\alpha)^2}}{\cos(\alpha)}$$

That leads to a 4th degree equation.

$$d^2 + 2dt \cos(\alpha) + t^2 \cos^2(\alpha) = w^2\frac{1 - \cos^2(\alpha)}{\cos^2(\alpha)}$$

$$d^2 \cos^2(\alpha) + 2dt \cos^3(\alpha) + t^2 \cos^4(\alpha) = w^2 (1 - \cos^2(\alpha))$$

My question is

Do I miss something? Is there an alternative solution?

• By the way, the issue is related to a roof editor in a CAD system YouTube - video Feb 1 '20 at 15:27
• You were missing a coefficient of $t^2$ in your last two equations; I took the liberty of adding them in. That done, I get the same result as you. There are other ways of attacking the problem (say, with the half-angle substitution), but a quartic appears inevitable.
– Blue
Feb 1 '20 at 15:40
• I take it this is a roof rafter: you can probably set $t=0$ as a first approximation in order to develop an iterative solution. Feb 1 '20 at 16:18