# sologuitar's question at Yahoo! Answers (perpencicular distance)

#### Fernando Revilla

##### Well-known member
MHB Math Helper
Here is the question:

Show that the perpendicular distance from the origin to the line y = mx + b is the absolute value of b divided by the square root of the quantity (1 + m^2).
Here is a link to the question:

Perpendicular Distance From (0,0)? - Yahoo! Answers

I have posted a link there to this topic so the OP can find my response.

#### Fernando Revilla

##### Well-known member
MHB Math Helper
Hello sologuitar,

In general the distance from the point $P_0=(x_0.y_0)$ to the line $r:Ax+By+C=0$ is

$$d(P_0,r)=\left|\dfrac{Ax_0+By_0+C}{\sqrt{A^2+B^2}}\right|$$

In our case, $P_0=(0,0)$ and $r:mx-y+b=0$ so,

$$d(P_0,r)=\left|\dfrac{m\cdot 0+(-1)\cdot 0+b}{\sqrt{m^2+(-1)^2}}\right|=\dfrac{\left|b\right|}{\sqrt{1+m^2}}$$

Staff member

#### soroban

##### Well-known member
Hello, all!

I'll solve this "from scratch".

$\text{Show that the perpendicular distance from the origin to the line }L:\;y \,=\,mx+b$
$\text{is the absolute value of }b\text{ divided by the square root of }(1+m^2).$

Code:
        |
| *
|   *  P
|     o
|    /  *
|   /     *
|  /d       *
| /           *
|/              *
- - * - - - - - - - - -
|O
The line $L$ has slope $m$.
The line through the origin has slope $\text{-}\frac{1}{m}$.

Point $P$ is the intersection of lines $y \:=\:mx+b$ and $y \:=\:\text{-}\frac{1}{m}x$

. . $mx + b \:=\:\text{-}\dfrac{1}{m}x \quad\Rightarrow\quad mx + \dfrac{1}{m}x \:=\:\text{-}b$

. . $\dfrac{m^2+1}{m}x \:=\:\text{-}b \quad\Rightarrow\quad x \:=\:\dfrac{\text{-}bm}{1+m^2}$

Then $y \:=\:\text{-}\dfrac{1}{m}\left(\dfrac{\text{-}bm}{1+m^2}\right) \quad\Rightarrow\quad y \:=\:\dfrac{b}{1+m^2}$

Point $P$ has coordinates: $\left(\dfrac{\text{-}bm}{1+m^2},\:\dfrac{b}{1+m^2}\right)$

Distance $OP$ is: .$d \;=\;\sqrt{\left(\dfrac{\text{-}bm}{1+m^2}\right)^2 + \left(\dfrac{b}{1+m^2}\right)^2} \;=\; \sqrt{\dfrac{b^2m^2}{(1+m^2)^2} + \dfrac{b^2}{(1+m^2)^2}}$

. . . . . . . . . . . $d \;=\;\sqrt{\dfrac{b^2(1+m^2)}{(1+m^2)^2}} \;=\;\sqrt{\dfrac{b^2}{1+m^2}}$

. . Therefore: .$d \;=\;\dfrac{|b|}{\sqrt{1+m^2}}$