Straight Lines
Slope and Forms of a Line
The slope (or gradient) of a line measures how steeply it rises or falls. If a line passes through two distinct points $(x_1, y_1)$ and $(x_2, y_2)$ with $x_1 \ne x_2$, its slope is the ratio of the change in $y$ to the change in $x$:
This single number captures everything about a line's direction. A positive slope means the line climbs left-to-right; a negative slope means it falls. A horizontal line has slope $0$ (no rise), while a vertical line has $x_1 = x_2$, so the denominator vanishes and the slope is undefined — not infinite, simply not a real number.
Slope as an angle. If a line makes an angle $\theta$ (measured anticlockwise from the positive $x$-axis, with $0^\circ \le \theta < 180^\circ$) of inclination, then:
So a line inclined at $45^\circ$ has slope $\tan 45^\circ = 1$, and one at $135^\circ$ has slope $\tan 135^\circ = -1$. Because $\tan 90^\circ$ is undefined, this is consistent with a vertical line having no slope.
Parallel and perpendicular lines. Two non-vertical lines with slopes $m_1$ and $m_2$ satisfy clean relationships you will use constantly:
| Relationship | Condition on slopes | Geometric meaning |
|---|---|---|
| Parallel | $m_1 = m_2$ | same inclination, never meet |
| Perpendicular | $m_1 \cdot m_2 = -1$ | cross at $90^\circ$ |
| Coincident | $m_1 = m_2$ and share a point | identical line |
| Same line / angle | $m_1 = m_2 = \tan\theta$ | equal inclination $\theta$ |
The perpendicular rule $m_1 m_2 = -1$ is equivalent to saying each slope is the negative reciprocal of the other: $m_2 = -\dfrac{1}{m_1}$.
Angle between two lines. The acute angle $\theta$ between two non-vertical, non-perpendicular lines of slopes $m_1$ and $m_2$ is given by:
Taking the absolute value guarantees you get the acute angle. Dropping the modulus gives one of the two supplementary angles the lines actually form. Notice that if $1 + m_1 m_2 = 0$ the formula blows up — which is exactly the perpendicular case, where the angle is $90^\circ$.
Deeper Insight — why slope is the DNA of a line: Slope is the one invariant that survives no matter which two points on the line you pick, and that permanence is what makes it so powerful. Choose any pair of points on the same line and the ratio $\tfrac{y_2-y_1}{x_2-x_1}$ comes out identical — this is the geometric face of the algebraic fact that a straight line has a constant rate of change. That constancy is precisely why $m = \tan\theta$ works: a fixed direction means a fixed inclination angle. The parallel and perpendicular conditions are not arbitrary rules to memorise but direct consequences — equal slopes force equal inclinations, and the $m_1 m_2 = -1$ condition is what you get when two inclinations differ by exactly $90^\circ$. When you reach calculus, this same slope reappears as the derivative: the slope of the tangent line is the instantaneous rate of change, so mastering slope now pays dividends far beyond coordinate geometry.
- Apply the slope formula with $(x_1, y_1) = (2, 3)$ and $(x_2, y_2) = (5, 9)$.
- $m = \dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{9 - 3}{5 - 2} = \dfrac{6}{3}$.
- Simplify: $m = 2$.
Answer: $m = 2$ (the line rises $2$ units for every $1$ unit right).
- Slope equals the tangent of the inclination: $m = \tan\theta = \tan 120^\circ$.
- $\tan 120^\circ = \tan(180^\circ - 60^\circ) = -\tan 60^\circ$.
- Since $\tan 60^\circ = \sqrt{3}$, we get $m = -\sqrt{3}$.
Answer: $m = -\sqrt{3}$.
- Slope of the first line: $m_1 = \dfrac{8 - 2}{4 - 1} = \dfrac{6}{3} = 2$.
- Slope of the second line: $m_2 = \dfrac{3 - (-1)}{2 - 0} = \dfrac{4}{2} = 2$.
- Since $m_1 = m_2 = 2$, the lines have equal slopes.
Answer: The lines are parallel ($m_1 = m_2 = 2$).
- For perpendicularity, the slope of our line must be the negative reciprocal of $-\dfrac{1}{2}$, namely $2$.
- Slope through $(3, k)$ and $(2, 7)$: $m = \dfrac{7 - k}{2 - 3} = \dfrac{7 - k}{-1} = k - 7$.
- Set $k - 7 = 2$, so $k = 9$.
Answer: $k = 9$.
- Use $\tan\theta = \left|\dfrac{m_2 - m_1}{1 + m_1 m_2}\right|$.
- Substitute: $\tan\theta = \left|\dfrac{\tfrac{1}{2} - 1}{1 + (1)(\tfrac{1}{2})}\right| = \left|\dfrac{-\tfrac{1}{2}}{\tfrac{3}{2}}\right| = \dfrac{1}{3}$.
- Therefore $\theta = \tan^{-1}\dfrac{1}{3} \approx 18.43^\circ$.
Answer: $\theta = \tan^{-1}\dfrac{1}{3} \approx 18.43^\circ$.
- Slope of the first line: $m_1 = \dfrac{4 - 0}{2 - 0} = 2$.
- Slope of the second line: $m_2 = \dfrac{4 - 5}{3 - 1} = \dfrac{-1}{2}$.
- Product of slopes: $m_1 m_2 = 2 \times \left(-\dfrac{1}{2}\right) = -1$.
Answer: Yes — since $m_1 m_2 = -1$, the lines are perpendicular.
- Slope $m = \dfrac{y_2 - y_1}{x_2 - x_1}$ is constant for any two points on the line; it is undefined for a vertical line.
- Slope equals the tangent of the inclination: $m = \tan\theta$, with $0^\circ \le \theta < 180^\circ$.
- Parallel lines have equal slopes; perpendicular lines satisfy $m_1 m_2 = -1$ (negative reciprocals).
- Acute angle between lines: $\tan\theta = \left|\dfrac{m_2 - m_1}{1 + m_1 m_2}\right|$.
- A vanishing denominator $1 + m_1 m_2 = 0$ signals the perpendicular case, where $\theta = 90^\circ$.
Distance and Angle
A straight line can be described algebraically in several equivalent ways. Each form is tailored to the information you happen to have — a point and a slope, two points, intercepts, or a perpendicular from the origin. Knowing which form to reach for is half the battle.
Point-slope form. If a line has slope $m$ and passes through a known point $(x_1, y_1)$, every other point $(x, y)$ on it satisfies:
This is the most fundamental form, because it is just the slope definition rearranged. Nearly every other form can be derived from it.
Two-point form. When two points $(x_1, y_1)$ and $(x_2, y_2)$ are given, compute the slope and substitute:
Slope-intercept form. If a line has slope $m$ and cuts the $y$-axis at $(0, c)$, then $c$ is the $y$-intercept and:
Intercept form. If a line cuts the $x$-axis at $(a, 0)$ and the $y$-axis at $(0, b)$, with $a, b \ne 0$:
Normal (perpendicular) form. If the perpendicular from the origin to the line has length $p > 0$ and makes angle $\omega$ with the positive $x$-axis:
General form. Every straight line can be written as a single linear equation:
From the general form you can read off the slope as $-\dfrac{A}{B}$ (when $B \ne 0$), the $x$-intercept as $-\dfrac{C}{A}$, and the $y$-intercept as $-\dfrac{C}{B}$. The table below summarises when each form is most convenient:
| Form | Equation | Use when you know |
|---|---|---|
| Point-slope | $y - y_1 = m(x - x_1)$ | one point and the slope |
| Two-point | $y - y_1 = \dfrac{y_2 - y_1}{x_2 - x_1}(x - x_1)$ | two points |
| Slope-intercept | $y = mx + c$ | slope and $y$-intercept |
| Intercept | $\dfrac{x}{a} + \dfrac{y}{b} = 1$ | both axis intercepts |
| Normal | $x\cos\omega + y\sin\omega = p$ | perpendicular distance from origin |
| General | $Ax + By + C = 0$ | any line (standard form) |
Deeper Insight — one line, many disguises: All six forms describe exactly the same kind of object, and any one can be algebraically rearranged into any other — they are disguises of a single linear relationship, not different lines. The general form $Ax + By + C = 0$ is the great unifier: it has no restrictions (it even handles vertical lines, where $B = 0$ and the slope-intercept form fails), which is why it is the standard you convert to when comparing or combining lines. The other forms are conveniences that let you skip arithmetic when you already have the right data — reaching for intercept form when you know where a line crosses the axes saves you from solving simultaneous equations. The normal form is the odd one out and the most geometric: it encodes the shortest distance $p$ from the origin and the direction $\omega$ of that shortest path, which is precisely why it leads naturally into the distance formula of the next topic. Fluency here is really fluency in translation — recognising the same line no matter which costume it wears.
- Use point-slope form $y - y_1 = m(x - x_1)$ with $m = 4$, $(x_1, y_1) = (2, 3)$.
- $y - 3 = 4(x - 2)$.
- Expand: $y - 3 = 4x - 8 \Rightarrow y = 4x - 5$.
Answer: $y = 4x - 5$, or in general form $4x - y - 5 = 0$.
- Slope $m = \dfrac{8 - 2}{3 - 1} = \dfrac{6}{2} = 3$.
- Two-point (via point-slope): $y - 2 = 3(x - 1)$.
- Expand: $y - 2 = 3x - 3 \Rightarrow y = 3x - 1$.
Answer: $y = 3x - 1$, i.e. $3x - y - 1 = 0$.
- Here $a = 4$ and $b = -2$, so use intercept form $\dfrac{x}{a} + \dfrac{y}{b} = 1$.
- $\dfrac{x}{4} + \dfrac{y}{-2} = 1$.
- Multiply through by $4$: $x - 2y = 4$.
Answer: $x - 2y = 4$, i.e. $x - 2y - 4 = 0$.
- Rearrange into slope-intercept form: $4y = -3x + 12$.
- Divide by $4$: $y = -\dfrac{3}{4}x + 3$.
- Compare with $y = mx + c$.
Answer: Slope $m = -\dfrac{3}{4}$ and $y$-intercept $c = 3$.
- Move the constant: $x + y = 4$. Here $A = 1$, $B = 1$, so $\sqrt{A^2 + B^2} = \sqrt{2}$.
- Divide both sides by $\sqrt{2}$: $\dfrac{x}{\sqrt{2}} + \dfrac{y}{\sqrt{2}} = \dfrac{4}{\sqrt{2}} = 2\sqrt{2}$.
- Compare with $x\cos\omega + y\sin\omega = p$: $\cos\omega = \sin\omega = \dfrac{1}{\sqrt{2}}$, so $\omega = 45^\circ$ and $p = 2\sqrt{2}$.
Answer: Normal form $x\cos 45^\circ + y\sin 45^\circ = 2\sqrt{2}$; distance $p = 2\sqrt{2}$.
- Slope of the given line: $-\dfrac{A}{B} = -\dfrac{2}{-3} = \dfrac{2}{3}$.
- A parallel line has the same slope $m = \dfrac{2}{3}$ and passes through $(0, 5)$.
- Slope-intercept form: $y = \dfrac{2}{3}x + 5$.
Answer: $y = \dfrac{2}{3}x + 5$, i.e. $2x - 3y + 15 = 0$.
- Point-slope: $y - y_1 = m(x - x_1)$ — the parent form from which the others follow.
- Slope-intercept $y = mx + c$ and intercept $\dfrac{x}{a} + \dfrac{y}{b} = 1$ are read directly from a graph.
- Normal form $x\cos\omega + y\sin\omega = p$ encodes the perpendicular distance $p$ from the origin.
- General form $Ax + By + C = 0$ describes every line; slope $= -\dfrac{A}{B}$ when $B \ne 0$.
- Any form can be rearranged into any other — they are the same line in different dress.
General Equation and Families
The distance from a point to a line always means the perpendicular distance — the length of the shortest segment from the point to the line. Any other segment from the point meets the line at an angle and is therefore longer.
For a line written in general form $Ax + By + C = 0$ and a point $(x_1, y_1)$, this shortest distance is:
The recipe is mechanical and reliable: substitute the point's coordinates into the left-hand side of the line's equation, take the absolute value of the result (distance is never negative), and divide by $\sqrt{A^2 + B^2}$, the magnitude of the coefficient pair. The line must be in the form $Ax + By + C = 0$ before you read off $A$, $B$, $C$ — a common slip is to forget to move all terms to one side first.
A neat special case: the distance from the origin $(0, 0)$ collapses to:
Distance between two parallel lines. Parallel lines never meet, so the gap between them is constant. If they are written with identical coefficients of $x$ and $y$:
then the perpendicular distance between them is:
The crucial precondition is highlighted in the table below — the $x$- and $y$-coefficients must be made identical before subtracting the constants.
| Situation | Formula | Watch out for |
|---|---|---|
| Point $(x_1, y_1)$ to line | $d = \dfrac{|Ax_1 + By_1 + C|}{\sqrt{A^2 + B^2}}$ | line must be $Ax + By + C = 0$ |
| Origin to line | $d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$ | just set $x_1 = y_1 = 0$ |
| Two parallel lines | $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}}$ | make $A, B$ identical first |
Deeper Insight — why the sign tells you which side: The absolute value in the distance formula hides a useful secret. Before you take the modulus, the signed quantity $\dfrac{Ax_1 + By_1 + C}{\sqrt{A^2 + B^2}}$ tells you not only how far the point is from the line but on which side of it the point lies — points on opposite sides give opposite signs, while points on the line give exactly zero. This is the foundation of how a line splits the plane into two half-planes, an idea you will rely on heavily in Linear Programming when shading feasible regions. The denominator $\sqrt{A^2 + B^2}$ is no accident either: it is the length of the normal vector $(A, B)$ to the line, and dividing by it converts the raw value $Ax_1 + By_1 + C$ into a true geometric distance measured along that perpendicular direction. The parallel-line formula is then just the same idea applied twice — both lines share the same normal direction, so their separation is simply the difference in their constant terms, scaled by that same length. Seen this way, all three formulas in this topic are really one formula wearing different hats.
- Here $A = 4$, $B = -3$, $C = -26$, and $(x_1, y_1) = (3, -5)$.
- Numerator: $|4(3) - 3(-5) - 26| = |12 + 15 - 26| = |1| = 1$.
- Denominator: $\sqrt{4^2 + (-3)^2} = \sqrt{16 + 9} = \sqrt{25} = 5$.
- $d = \dfrac{1}{5}$.
Answer: $d = \dfrac{1}{5}$ units.
- For the origin, use $d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$ with $C = -10$.
- Denominator: $\sqrt{3^2 + 4^2} = \sqrt{25} = 5$.
- $d = \dfrac{|-10|}{5} = \dfrac{10}{5} = 2$.
Answer: $d = 2$ units.
- The coefficients of $x$ and $y$ already match, so $A = 3$, $B = 4$, $C_1 = 5$, $C_2 = -15$.
- Use $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}} = \dfrac{|5 - (-15)|}{\sqrt{9 + 16}}$.
- $d = \dfrac{20}{5} = 4$.
Answer: $d = 4$ units.
- Make the coefficients identical. Multiply the first by $2$: $4x + 6y = 8$, i.e. $4x + 6y - 8 = 0$.
- The second is $4x + 6y - 7 = 0$. Now $A = 4$, $B = 6$, $C_1 = -8$, $C_2 = -7$.
- $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}} = \dfrac{|-8 - (-7)|}{\sqrt{16 + 36}} = \dfrac{1}{\sqrt{52}} = \dfrac{1}{2\sqrt{13}}$.
Answer: $d = \dfrac{1}{2\sqrt{13}}$ units.
- Distance: $\dfrac{|3(1) + 4(2) - p|}{\sqrt{3^2 + 4^2}} = \dfrac{|11 - p|}{5} = 4$.
- So $|11 - p| = 20$, giving $11 - p = 20$ or $11 - p = -20$.
- Solve: $p = -9$ or $p = 31$.
Answer: $p = -9$ or $p = 31$.
- Here $A = 5$, $B = -12$, $C = 13$, and $(x_1, y_1) = (-2, 3)$.
- Numerator: $|5(-2) - 12(3) + 13| = |-10 - 36 + 13| = |-33| = 33$.
- Denominator: $\sqrt{5^2 + (-12)^2} = \sqrt{25 + 144} = \sqrt{169} = 13$.
- $d = \dfrac{33}{13}$.
Answer: $d = \dfrac{33}{13}$ units.
- Distance from a point to a line is always the perpendicular (shortest) distance.
- $d = \dfrac{|Ax_1 + By_1 + C|}{\sqrt{A^2 + B^2}}$ — put the line in $Ax + By + C = 0$ form first.
- From the origin this simplifies to $d = \dfrac{|C|}{\sqrt{A^2 + B^2}}$.
- Parallel lines: $d = \dfrac{|C_1 - C_2|}{\sqrt{A^2 + B^2}}$ — make the $x, y$ coefficients identical before subtracting.
- The sign of $Ax_1 + By_1 + C$ (before the modulus) reveals which side of the line the point lies on.