Answer
$d=(h_{2}-h_{1})\cot\theta$
Work Step by Step
In the triangle shown, $d$ is the base while $h_{2}-h_{1}$ is the perpendicular. We first use the $tangent$ formula and substitute the values of base and perpendicular in it:
$\tan \theta=\frac{perpendicular}{base}$
$\tan \theta=\frac{h_{2}-h_{1}}{d}$
Next, we know that the cotangent function is the inverse of the tangent function. So the above equation becomes,
$\cot \theta=\frac{d}{h_{2}-h_{1}}$
Rearranging this equation, we get:
$d=(h_{2}-h_{1})\cot\theta$