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 θ = DM/CM
⇒ tan θ = h/x
⇒ x = h/tanθ = h cot θ ….(i)
From right angled ΔDMA,
tan α = DM/AM
tan α = h/(a + x)
⇒ a + x = h/tanα = h cot α
⇒ a = h cot α – x
= h cot α – h cot θ
= h[cot α – cot θ] ……(ii)
For right angled ∆DMB,
tan β = DM/BM
cot β = BM/DM
cot β = (b + x)/h
b + x = h cot β
b = h cot β – x
b = h cot β – h cot θ
= h [cot β – cot θ] ……(iii)
Divide equation (iii) in equation (ii),
a/b = h(cotα - cotθ)/h(cotβ - cotθ)
⇒ a(cot β – cot θ) = b(cot α – cot θ)
⇒ (b – a)cot θ = b cot α – a cot β
⇒ cotθ = (bcotα - αcotβ)/(b - α)