16. Given an angle of magnitude $\alpha$ with vertex at $A$ and a point $B$ at distances $a$ and $b$ from the sides of the angle. Find the length of $A B$.
16. If $M$ and $N$ are the bases of the perpendiculars dropped from $B$ to the sides of the angle, then the quadrilateral $A M B N$ is cyclic, and $A B$ is the diameter of the circle circumscribed around $\triangle M B N$, so $\widehat{M B N}=\pi-\alpha$ if $B$ is inside the given angle or its vertical, and $\widehat{M B N}=\alpha$ in other cases; $|A B|=\frac{|M N|}{\sin \alpha}$.

Answer: $|A B|=\frac{\sqrt{a^{2}+b^{2}+2 a b \cos \alpha}}{\sin \alpha}$, if $B$ lies inside the given angle or its vertical; $|A B|=\frac{\sqrt{a^{2}+b^{2}-2 a b \cos \alpha}}{\sin \alpha}$ in other cases.