Firstly, vector diagrams always help. Here is one for this situation
![1641305411527.png](/data/attachments/34/34596-a8074b9ee1049ae90addaa4f8d6f89d8.jpg)
The blue line is line
l
The projection is the vector from A to the intersection of the purple and blue lines in the bottom right
The purple line is the 'perpendicular distance' we aim to solve for
The black line is vector
AP
The projection is perpendicular to the vector that it projects onto (line
l). So the intersection of the blue and purple lines is a right angle.
You now have a right-angled triangle. Solving by pythagoras' theorem gives the answer of
![](https://latex.codecogs.com/png.latex?\bg_white 2\sqrt{10})