# How long is the diagonal of this trapezoid?

Given a trapezoid $abcd$, with $|ab| = 1$, and angles $\angle dab = 3\theta/4$, $\angle abc = (\pi + \theta)/2$, $\angle bcd = (\pi - \theta)/2$, and $\angle cda = \pi - 3\theta/4$ (see figure below), what is the length of $ac$, in terms of $\theta$?

I have a solution that uses the law of cosines after computing the lengths of $ad$ and $dc$, but the final answer is very messy: $|ac| = \frac{1}{2} \sqrt{4\sec\left(\frac{\theta}{2}\right) + 7\sec^2\left(\frac{\theta}{2}\right) + 4\sec^3\left(\frac{\theta}{2}\right) + \sec^4\left(\frac{\theta}{2}\right) - 8\cos\left(\frac{\theta}{2}\right) - 4} + \tan\left(\frac{\theta}{2}\right) + \frac{1}{2}\sec\left(\frac{\theta}{2}\right)\tan\left(\frac{\theta}{2}\right)$

Is there a nicer expression for this?

If it helps, you may assume that $\theta = 2\pi/k$, for some integer $k \geq 9$. Something else that might be useful is that triangles $\triangle abd$ and $\triangle bdc$ are similar, but I haven't found a way to exploit this yet.

Define $$\theta_1 := \frac{3\theta}{4} \,,\,\, \theta_2 := \frac{2\pi - \theta}{4} \,,\,\, \theta_3 := \pi - \theta_1 - \theta_2 \,.$$ Assume that $\theta_2$ is acute. Project $a$ and $b$ on to the line containing $c$ and $d$ to get points $a_1$ and $b_1$. Project $c$ on to the line containing $a$ and $b$ to get point $c_1$. Define $$l_1 := |ab| = 1 ~,~~ l_2 := |bc_1| ~,~~ l_3 := |a_1d| ~,~~ l_4 := |db_1| ~,~~ l_5 := |b_1c|$$
Then, if $h$ is the height of the trapezoid, $$l_2 = l_5 = h\cot\theta_3 ~,~~ l_3 = h\cot\theta_1 ~;~~ l_4 = h\cot\theta_2 \,.$$ Use $l_1 + l_2 = l_3 + l_4 + l_5$ to solve for $h$ to get $$h = \frac{1}{\cot\left(\frac{3\theta}{4}\right) + \tan\left(\frac{\theta}{4}\right)}$$ The length $l_0 := |ac|$ is given by $$l_0 = \sqrt{h^2 + (l_1+l_2)^2} = \sqrt{h^2 + (l_3+l_4+l_5)^2}$$ If you use the first equation above, you get $$l_0 = \frac{1}{\alpha}\sqrt{1 + \left(\alpha + \tan\frac{\theta}{2}\right)^2}$$ where $$\alpha := \cot\left(\frac{3\theta}{4}\right) + \tan\left(\frac{\theta}{4}\right) + \tan\left(\frac{\theta}{2}\right)$$ If you use the second you get (if my algebra is correct) $$l_0 = \sqrt{\frac{6 + 4\cos(\theta/2) + 3\cos\theta - 3\cos(3\theta/2) - \cos(2\theta) - cos(5\theta/2)}{3 + 4\cos\theta + \cos(2\theta)}}$$ Actually, your final answer looks pretty nice compared with my solution.