Skip to content

Mathematics · Ch 9 — Straight Lines

Slope of a Line When Coordinates of Any Two Points on the Line Are Given

9.2.1

Slope of a Line When Coordinates of Any Two Points on the Line Are Given

Concept: Slope from Two Points

A line is completely determined by any two points on it. Given two points, we can find the line's slope — the measure of its steepness — without needing a diagram. The slope is simply the ratio of the vertical change to the horizontal change between the two points.

Consider a non-vertical line ll passing through two distinct points P(x1,y1)P(x_1, y_1) and Q(x2,y2)Q(x_2, y_2). Because the line is non-vertical, x1≠x2x_1 \neq x_2; if x1=x2x_1 = x_2, the line would be vertical and its slope would be undefined. Let the inclination of the line be θ\theta. The inclination may be acute (0∘<θ<90∘0^\circ < \theta < 90^\circ) or obtuse (90∘<θ<180∘90^\circ < \theta < 180^\circ). We treat both cases separately to derive a single, unified formula.


Derivation for Acute Inclination (θ\theta acute)

Draw perpendiculars from PP and QQ to the axes as shown in the textbook figure. From PP, draw a horizontal line to meet the vertical line through QQ at point MM. In the right triangle △MPQ\triangle MPQ, the angle at PP equals θ\theta (corresponding angles with the transversal).

In △MPQ\triangle MPQ:

  • The vertical side MQ=y2−y1MQ = y_2 - y_1
  • The horizontal side MP=x2−x1MP = x_2 - x_1

By definition of slope:

m=tan⁡θm = \tan \theta

From the triangle:

tan⁡θ=MQMP=y2−y1x2−x1\tan \theta = \frac{MQ}{MP} = \frac{y_2 - y_1}{x_2 - x_1}

Therefore:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}


Derivation for Obtuse Inclination (θ\theta obtuse)

When θ\theta is obtuse, the acute angle inside △MPQ\triangle MPQ is 180∘−θ180^\circ - \theta. In this case, ∠MPQ=180∘−θ\angle MPQ = 180^\circ - \theta.

Now, θ=180∘−∠MPQ\theta = 180^\circ - \angle MPQ.

Using the tangent identity for supplementary angles:

tan⁡(180∘−α)=−tan⁡α\tan(180^\circ - \alpha) = -\tan \alpha

So:

m=tan⁡θ=tan⁡(180∘−∠MPQ)=−tan⁡(∠MPQ)m = \tan \theta = \tan(180^\circ - \angle MPQ) = -\tan(\angle MPQ)

In △MPQ\triangle MPQ, tan⁡(∠MPQ)=MQMP=y2−y1x2−x1\tan(\angle MPQ) = \frac{MQ}{MP} = \frac{y_2 - y_1}{x_2 - x_1}.

Thus:

m=−y2−y1x2−x1=−(y2−y1)x2−x1=y1−y2x2−x1m = -\frac{y_2 - y_1}{x_2 - x_1} = \frac{-(y_2 - y_1)}{x_2 - x_1} = \frac{y_1 - y_2}{x_2 - x_1}

But y1−y2x2−x1=y2−y1x1−x2=y2−y1x2−x1\frac{y_1 - y_2}{x_2 - x_1} = \frac{y_2 - y_1}{x_1 - x_2} = \frac{y_2 - y_1}{x_2 - x_1} (multiplying numerator and denominator by −1-1).

Hence, the same formula holds:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

Important

The slope formula is identical for both acute and obtuse inclinations. The sign of the slope automatically accounts for the direction of the line.


The Unified Formula

For any two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a non-vertical line, the slope mm is:

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

This is the fundamental result of this section. The order of subtraction does not matter as long as it is consistent: y2−y1x2−x1=y1−y2x1−x2\frac{y_2 - y_1}{x_2 - x_1} = \frac{y_1 - y_2}{x_1 - x_2}.

Watch out

This formula fails for vertical lines (x1=x2x_1 = x_2). For vertical lines, slope is undefined. Also, if y1=y2y_1 = y_2, the slope is 00, indicating a horizontal line.


Key Observations

  1. Consistency: The slope is independent of which point is labelled (x1,y1)(x_1, y_1) and which is (x2,y2)(x_2, y_2), as long as the subtraction is consistent in numerator and denominator.

  2. Sign of slope: …

Figure 9.3Slope of a line from two points (acute and obtuse cases)
Fig. 9.3 — Slope of a line from two points (acute and obtuse cases)

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

The figure shows a single non-vertical line ll in two different orientations, drawn on a standard xyxy-coordinate plane. In both panels, two fixed points P(x1,y1)P(x_1, y_1) and Q(x2,y2)Q(x_2, y_2) lie on the line. The key construction is the same in both cases: from QQ, a vertical line is dropped straight down to meet the xx-axis at point RR (so QRQR is perpendicular to the xx-axis). From PP, a horizontal line is drawn to meet QRQR at point MM (so PMPM is perpendicular to RQRQ). This creates a right-angled triangle △MPQ\triangle MPQ, with the right angle at MM.

The difference between the two panels is the sign of the line's slope. In panel (i), the line runs upward as we move from left to right — the inclination θ\theta (the angle the line makes with the positive xx-axis, measured anticlockwise) is acute, less than 90∘90^\circ. Here, the angle at PP inside the triangle, ∠MPQ\angle MPQ, is exactly equal to θ\theta. In panel (ii), the line runs downward as we move left to right — the inclination θ\theta is obtuse, greater than 90∘90^\circ. In this case, the interior angle at PP in the triangle is the supplement of θ\theta: ∠MPQ=180∘−θ\angle MPQ = 180^\circ - \theta.

The physical idea is simple: the slope of a line is the ratio of the vertical change to the horizontal change between any two points on it. The figure shows that this ratio can be read directly from the right triangle formed by the two points and the coordinate axes. The vertical leg MQMQ has length ∣y2−y1∣|y_2 - y_1|, and the horizontal leg MPMP has length ∣x2−x1∣|x_2 - x_1|. The sign of the slope is determined by whether yy increases or decreases as xx increases — that is, whether the line is rising or falling.

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

This single formula works for both acute and obtuse inclinations. In the acute case, tan⁡θ=MQMP=y2−y1x2−x1\tan \theta = \frac{MQ}{MP} = \frac{y_2 - y_1}{x_2 - x_1} directly. In the obtuse case, tan⁡θ=tan⁡(180∘−∠MPQ)=−tan⁡(∠MPQ)=−MQMP=−y2−y1x2−x1\tan \theta = \tan(180^\circ - \angle MPQ) = -\tan(\angle MPQ) = -\frac{MQ}{MP} = -\frac{y_2 - y_1}{x_2 - x_1}, but careful: because x2<x1x_2 < x_1 in that panel, the denominator x2−x1x_2 - x_1 is negative, and the negative signs cancel to give exactly the same expression y2−y1x2−x1\frac{y_2 - y_1}{x_2 - x_1}. …