
Consider the line $\overleftrightarrow{l}$ whose equation is $Ax+By+C=0$, and the point $P(x_1,y_1)$ as shown above. Suppose $\overleftrightarrow{l}$ intersects the $x$ and $y$ axis at points $M$ and $N$ respectively.
To find the distance between $P$ and $\overleftrightarrow{l}$, let’s first find the distance between the $x$ and y-intercepts of $\overleftrightarrow{l}$.
So, the length $MN$ is given as $\left| \dfrac{C}{AB}\right| \sqrt{A^{2}+B^{2}}$

We found the length of $MN$ as $\left| \dfrac{C}{AB}\right| \sqrt{A^{2}+B^{2}}$ units. Now, suppose $PQ$ is the perpendicular drawn from $P$ to $\overleftrightarrow{l}$ as shown above.
We know that area of a triangle is given as
$$Area =\dfrac{1}{2}× Base × Height$$
So, using this result, we can write:
$$Area \triangle{PMN}=12×MN×PQ$$
$$\Rightarrow Area \triangle{PMN}=\dfrac{1}{2}× \left| \dfrac{C}{AB}\right| \sqrt{A^{2}+B^{2}} ×PQ$$
$$\Rightarrow PQ=2\times\left| \dfrac{AB}{C}\right| \dfrac{1}{\sqrt{A^2+B^2}} \times Area \triangle{PMN}$$
We found the distance $PQ$ as $$PQ=\left| \dfrac{2AB}{C\sqrt{A^{2}+B^{2}}}\right| Area △PMN$$
Now Consider the above △PMN again; We know that the area of a triangle having vertices at $(x_1,y_1),(x_2,y_2)$ and $(x_3,y_3)$ is given as
$$Area = \frac{1}{2}\left|x_{1}\left(y_{2}-y_{3}\right)+x_{2}\left(y_{3}-y_{1}\right)+x_{3}\left(y_{1}-y_{2}\right)\right|$$
So, using the above result, Area $\triangle{PMN}$ becomes $\dfrac{1}{2}\left| \dfrac{C}{AB}\right| \cdot \left| Ax_1 +By_1 + C\right|$ sq. units.
We found the following:
- $P Q=\left|\frac{2 A B}{C \sqrt{A^{2}+B^{2}}}\right|$ Area $\triangle P M N \quad \ldots(\mathrm{i})$
- Area $\triangle P M N=\frac{1}{2}\left|\frac{C}{A B}\right| \cdot\left|A x_{1}+B y_{1}+C\right| s q .$ units $\cdots (2)$
From (i) and (ii), we'll get:
$$
P Q=\frac{\left|A x_{1}+B y_{1}+C\right|}{\sqrt{A^{2}+B^{2}}}
$$
Therefore, the perpendicular $distance (d)$ between the point $P(x_1,y_1)$ and the line $Ax+By+C=0$ is given as $d=\dfrac{\left | Ax_{1} + By_{1} + C\right |}{\sqrt{A^2 + B^2} }$