Let CD is a leaning tower and angles of elevations of top of point D at the place A and B are α and β.
So, ∠DBM=β,∠DAM=α
Let ∠DCM=θ and DM=h m, CM=x m and AC=a,BC=b.
From right angled ΔDMC,
tanθ=DMCM
tanθ=hx
x=htanθ=hcotθ ….(i)
From right angled ΔDMA,
tanα=DMAM
tanα=ha+x
a+x==hcotα
a=hcotα–x
=hcotα–hcotθ
=h[cotα–cotθ] ……(ii)
For right angled ΔDMB,
tanβ=DMBM
cotβ=BMDM
cotβ=b+xh
b+x=hcotβ
b=hcotβ–x
b=hcotβ–hcotθ
=h[cotβ–cotθ] ……(iii)
Divide equation (iii) in equation (ii),
ab=h(cotα−cotθ)h(cotβ−cotθ)
a(cotβ–cotθ)=b(cotα–cotθ)
(b–a)cotθ=bcotα–acotβ
cotθ=bcotα−αcotβb−a