Let CD and AB be the poles of height 15 m and 8 m.
Therefore, CP = (15 - 8) m = 7 m
From the figure, it can be observed that AP = 24 m.
Applying Pythagoras' theorem for ΔAPC, we get
AC2=PC2+AP2.
AC2=72+242
AC2=49+576=625m2
AC = 25 m
Therefore, the distance between the top ends of the poles is 25 m.