TITLE: Why is the equations for a perpendicular line $-\frac{1}{m}$?
QUESTION [5 upvotes]: Why is it just $-m$? Lets say $y=x$ and the $y$ intercept is at $0$ if we created another line that was $y=-x$, wouldn't that make it perpendicular?
Note: Don't exactly know what tags to use, feel free to edit

REPLY [2 votes]: If both perpendicular lines have a slope, neither of them is vertical.  If a line is not vertical, then the line perpendicular to it cannot be horizontal.  Thus, neither line has slope equal to zero.
We can choose our coordinate system so that the non-vertical perpendicular lines intersect at the origin, as shown in the diagram below.
If one line has slope $m$ and the line perpendicular to it has slope $m'$, then they have equations $y = mx$ and $y = m'x$, respectively (since the $y$-intercept is $0$).  
The line with slope $m$ intersects the vertical line $x = 1$ at the point $(1, m)$, while the line with slope $m'$ intersects the vertical line $x = 1$ at the point $(1, m')$.  
The three lines form a right triangle with vertices $(0, 0)$, $(1, m)$, and $(1, m')$.  
We can use the Distance Formula to determine the lengths of the legs and the hypotenuse.  The Distance Formula states that the distance between points $P_1(x_1, y_1)$ and $P_2(x_2, y_2)$ is 
$$d(P_1, P_2) = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$$
The length of the leg from the origin to the point $(1, m)$ is $\sqrt{1 + m^2}$.  The length of the leg from the origin to the point $(1, m')$ is $\sqrt{1 + m'^2}$.  The length of the hypotenuse is the distance from $(1, m)$ to the point $(1, m')$, which is $|m - m'|$.  By the Pythagorean Theorem,
\begin{align*}
\sqrt{1 + m^2}^2 + \sqrt{1 + m'^2}^2 & = |m - m'|^2\\
1 + m^2 + 1 + m'^2 & = (m - m')^2\\
2 + m^2 + m'^2 & = m^2 - 2mm' + m'^2\\
2 & = -2mm'\\
-\frac{1}{m} & = m'\\
\end{align*}