Just take CPhill's ending equation and tweak it a bit.
$$\underset{\,\,\,\,^{\textcolor[rgb]{0.66,0.66,0.66}{360^\circ}}}{{tan}}{\left({\mathtt{12.5}}^\circ\right)} = {\frac{{\mathtt{4}}}{{\mathtt{x}}}}$$
To isolate 'x' is a bit tricky. First, you have to multiply the '4/x' by 'x' and do the same to the other side.
$${x}{\left(\underset{\,\,\,\,^{\textcolor[rgb]{0.66,0.66,0.66}{360^\circ}}}{{tan}}{\left({\mathtt{12.5}}^\circ\right)}\right)} = {\mathtt{4}}$$
Now divide both sides by tan(12.5)
$${\mathtt{x}} = {\frac{{\mathtt{4}}}{\underset{\,\,\,\,^{\textcolor[rgb]{0.66,0.66,0.66}{360^\circ}}}{{tan}}{\left({\mathtt{12.5}}^\circ\right)}}}$$
Solve.
$${\frac{{\mathtt{4}}}{\underset{\,\,\,\,^{\textcolor[rgb]{0.66,0.66,0.66}{360^\circ}}}{{tan}}{\left({\mathtt{12.5}}^\circ\right)}}} = {\mathtt{18.042\: \!834\: \!014\: \!643\: \!337\: \!4}}$$
The basketball player is now approx 18.04 feet from the center of the rim.