The top of a hill observed from the top and bottom of a building of height h is at angles of elevation p and q respectively. The height of the hill is
h cot pcotp−cotq
h cot qcotp−cotq
h cot pcotp+cotq
h cot qcotp+cotq
We have tanq=xd⇒d=xcotq,tanp=x−hd⇒d=x−hcotp
⇒xcotq=x−hcotp
⇒xcotp−xcotq=hcotp
⇒x=hcotpcotp−cotq