Let the height of the tower be h and the horizontal distance from the base of the post to the tower be x. Using the angle of elevation alpha at the top of the post P, we get tan(alpha) = (h - a)/x; using the angle beta at the bottom of the post Q, we get tan(beta) = h/x. Substituting x = h/tan(beta) into the first equation yields tan(alpha) = ((h - a)tan(beta))/h, which simplifies to h = (a*tan(beta))/(tan(beta) - tan(alpha)). By converting the tangents to sines and cosines, this becomes h = (a*sin(alpha)*cos(beta))/sin(alpha - beta).