\frac{x}{\sin\theta}=\frac{a}{\sin(\pi-\varphi)}=\frac{a}{\sin\varphi