AB = a metres, CD = b metres
Distance between them is p metres
O is the point of intersection of BC and AD.
OL is perpendicular to AC
Let OL = h metres
Triangle ABC ~ triangle LOC as angles CAB and CLO are right angles and angle C is common.
Triangle ALO ~ triangle ACD as angles ALO and ACD are right angles and angle A is common.
From equations (1) and (2)