Academy
Formulas/maths/Straight Lines/Condition for Perpendicular Lines

Condition for Perpendicular Lines

Two non-vertical lines are perpendicular if and only if the product of their slopes is −1.
Derivation

Let two lines have inclinations θ1\theta_1 and θ2\theta_2. If they are perpendicular:

θ2=θ1+90°\theta_2 = \theta_1 + 90°

Then:

m2=tanθ2=tan(θ1+90°)=cotθ1=1tanθ1=1m1m_2 = \tan\theta_2 = \tan(\theta_1 + 90°) = -\cot\theta_1 = -\frac{1}{\tan\theta_1} = -\frac{1}{m_1}

Therefore:

m1m2=1\boxed{m_1 m_2 = -1}

Geometric interpretation

If line L1L_1 has slope mm, a vector along it is (1,m)(1, m). A vector along a line perpendicular to L1L_1 is (m,1)(-m, 1) (rotate 90°). The slope of the perpendicular is 1m=1m\frac{1}{-m} = -\frac{1}{m}, giving m(1m)=1m \cdot (-\frac{1}{m}) = -1.

Edge cases

If one line is horizontal (m1=0m_1 = 0), the perpendicular is vertical (undefined slope) — handle separately.

If one line is vertical (undefined slope), the perpendicular is horizontal (m=0m = 0) — handle separately.

Key Idea
Vector form. Let $\vec{d_1} = (1, m_1)$ and $\vec{d_2} = (1, m_2)$ be direction vectors of the two lines. Perpendicularity means:
> > $$ > \vec{d_1} \cdot \vec{d_2} = 0 > $$ > > Computing: $(1)(1) + (m_1)(m_2) = 1 + m_1 m_2 = 0$, which gives $m_1 m_2 = -1$. > > The dot product condition $\vec{d_1} \cdot \vec{d_2} = 0$ is the universal test — it works in 2D, 3D, and any dimension, and handles vertical/horizontal lines without special cases (use direction vectors $(0,1)$ and $(1,0)$ respectively).