Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Straight LinesSlope of a Line

Reading time: ~35 min

Riya cycles to college every morning, and her route has two climbs: the long, gentle ramp up to the flyover and the short, brutal lane up to the temple. Both are straight, both go up, and her legs can tell at once which one is steeper. Mathematics needs a number for that feeling.

A line in the coordinate plane makes two angles with the x-axis, one on each side of it, and the two always add up to 180^\circ — they are supplementary. To avoid any doubt we always use the same one: the angle \theta turned anticlockwise from the positive direction of the x-axis to the line. It is called the inclination of the line, and 0^\circ \le \theta \le 180^\circ.

Fig 9.2 is live. The blue line turns about the point (-2, 0), and the purple wedge is its inclination \theta.

Turn the line and complete all three missions.

Inclination \theta = ${t}°

A line parallel to the x-axis, or lying on it, has inclination . A vertical line — parallel to the y-axis, or the y-axis itself — has inclination 90°.

Definition 1: If \theta is the inclination of a line l, then \tan\theta is called the slope or gradient of l. It is written m:

m = \tan\theta, \quad \theta \neq 90^\circ

A vertical line has no slope, because \tan 90^\circ is not defined. So the slope of the x-axis is 0, and the slope of the y-axis is not defined.

Reading a slope at a glance

The orange steps in Fig 9.2 show what the number means: move 1 unit to the right along the line and it rises by m units. A gentle line has a small slope and a steep one a large slope. A line that rises to the right has a slope, a line that falls has a negative slope, and a horizontal line has slope 0. As \theta gets close to 90^\circ, \tan\theta grows without limit — which is why a vertical line has no slope at all.

Rise Over Run

Measuring the angle with a protractor is slow and imprecise. In coordinate geometry a line usually comes with two points on it — and two points fix a line completely. So let's get the slope straight from their coordinates.

Drag P and Q (a press grabs whichever is nearer) and complete the three missions. Watch the run and the rise between the two points.

Why does rise ÷ run give \tan\theta? Take two points P(x_1, y_1) and Q(x_2, y_2) on a non-vertical line l with inclination \theta. As the line is not vertical, x_1 \neq x_2 — otherwise the line would be to the x-axis and have no slope. Draw QR perpendicular to the x-axis and PM perpendicular to RQ. The inclination is either acute or obtuse, so there are two cases.

Both cases are below — switch between the tabs.

Case 1: θ acute

PM is parallel to the x-axis, so \angle MPQ = \theta. In the right triangle MPQ,

\tan\theta = \dfrac{MQ}{MP} = \dfrac{y_2 - y_1}{x_2 - x_1}

so m = \tan\theta = \dfrac{y_2 - y_1}{x_2 - x_1}.

Case 2: θ obtuse

Now \angle MPQ = 180^\circ - \theta, so \theta = 180^\circ - \angle MPQ and

m = \tan\theta = \tan(180^\circ - \angle MPQ) = -\tan\angle MPQ

= -\dfrac{MQ}{MP} = -\dfrac{y_2 - y_1}{x_1 - x_2} = \dfrac{y_2 - y_1}{x_2 - x_1}

In both cases the slope comes out the same way.

Slope from two points. For any two points (x_1, y_1) and (x_2, y_2) on a non-vertical line,

m = \dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{\text{rise}}{\text{run}}

It does not matter which point you call the first: swapping them changes the sign of both the top and the bottom, so m stays the .

Twins and Crossroads

Chandigarh was planned on a grid: its main roads either run side by side and never meet, or cross each other at right angles. Slopes tell these two situations apart at a glance.

In the plane below, the blue line L_1 is fixed: it passes through (-4, -3) and (2, 1), so its slope is \tfrac{2}{3}. The green line L_2 always passes through A(1, -2); you move its second point B. Drag B and complete both missions.

Here is why the slopes behave that way. Let non-vertical lines l_1 and l_2 have slopes m_1 and m_2 and inclinations \alpha and \beta.

Parallel lines. If l_1 is parallel to l_2 (Fig 9.4 — your first mission), they make the same angle with the x-axis, so \alpha = \beta and \tan\alpha = \tan\beta, i.e. m_1 = m_2. Conversely, if m_1 = m_2 then \tan\alpha = \tan\beta; between 0^\circ and 180^\circ the tangent never takes the same value twice, so \alpha = \beta and the lines are parallel. So two non-vertical lines are parallel if and only if their slopes are .

Perpendicular lines. If l_1 \perp l_2 (Fig 9.5 — your second mission), then \beta = \alpha + 90^\circ, so

\tan\beta = \tan(\alpha + 90^\circ) = -\cot\alpha = -\dfrac{1}{\tan\alpha}, i.e. m_2 = -\dfrac{1}{m_1}, or m_1 m_2 = .

Conversely, if m_1 m_2 = -1, then \tan\alpha = -\cot\beta = \tan(\beta \pm 90^\circ), so \alpha and \beta differ by 90^\circ and the lines are perpendicular. So two non-vertical lines are perpendicular if and only if their slopes are negative reciprocals of each other.

Two quick tests

  • Parallel: equal slopes, m_1 = m_2.
  • Perpendicular: slopes that multiply to −1, m_1 m_2 = -1. In practice: flip the fraction and change its sign, so \tfrac{2}{3} becomes -\tfrac{3}{2}.

Both tests need slopes, so neither works for a vertical line. A vertical line and a horizontal line are still perpendicular — the picture says so, even though m_1 m_2 = -1 cannot be checked.

Example 1 : Find the slope of the line

(a) through the points (3, -2) and (-1, 4),

(b) through the points (3, -2) and (7, -2),

(c) through the points (3, -2) and (3, 4),

(d) making an inclination of 60^\circ with the positive direction of the x-axis.

Solution : (a) m = \dfrac{4 - (-2)}{-1 - 3} = \dfrac{6}{-4} = .

(b) m = \dfrac{-2 - (-2)}{7 - 3} = \dfrac{0}{4} = — the line is horizontal.

(c) m = \dfrac{4 - (-2)}{3 - 3} = \dfrac{6}{0}, which is — the line is vertical.

(d) m = \tan 60^\circ = .

Where Two Lines Cross

Two lines in a plane either never meet — they are parallel — or they cross. When they cross they make two pairs of vertically opposite angles, and any two neighbouring angles add up to 180^\circ. Can the two slopes alone tell us the angle between the lines?

Fig 9.6 below is live, and both of its lines pass through the origin.

Set the two slopes and complete both missions.

m_1 = ${m1}

m_2 = ${m2}

The blue line has slope m_1 and the green line has slope m_2; the purple wedge is the acute angle \theta between them.

Here is where the formula comes from. Let L_1 and L_2 be non-vertical lines with inclinations \alpha_1 and \alpha_2, so that m_1 = \tan\alpha_1 and m_2 = \tan\alpha_2. If \theta and \varphi are the two neighbouring angles between the lines, then \theta = \alpha_2 - \alpha_1 and \varphi = 180^\circ - \theta. The formula for the tangent of a difference gives

\tan\theta = \dfrac{\tan\alpha_2 - \tan\alpha_1}{1 + \tan\alpha_1\tan\alpha_2} = \dfrac{m_2 - m_1}{1 + m_1 m_2}, provided 1 + m_1 m_2 \neq 0,

and \tan\varphi = \tan(180^\circ - \theta) = -\tan\theta.

So \tan\theta and \tan\varphi always have opposite signs. If \dfrac{m_2 - m_1}{1 + m_1 m_2} is positive, \theta is and \varphi is obtuse; if it is negative, \theta is obtuse and \varphi is acute. Either way, taking the absolute value picks out the acute angle.

Angle between two lines. The acute angle \theta between two lines with slopes m_1 and m_2 is given by

\tan\theta = \left|\dfrac{m_2 - m_1}{1 + m_1 m_2}\right|, \quad 1 + m_1 m_2 \neq 0 \qquad \ldots (1)

The obtuse angle is \varphi = 180^\circ - \theta. When 1 + m_1 m_2 = 0, the lines are perpendicular — exactly as in your second mission.

Example 2 : If the angle between two lines is \dfrac{\pi}{4} and the slope of one of them is \dfrac{1}{2}, find the slope of the other line.

Solution : Put m_1 = \dfrac{1}{2}, m_2 = m and \theta = \dfrac{\pi}{4} into formula (1):

\tan\dfrac{\pi}{4} = \left|\dfrac{m - \frac{1}{2}}{1 + \frac{1}{2}m}\right|, i.e. 1 = \left|\dfrac{m - \frac{1}{2}}{1 + \frac{1}{2}m}\right|.

An absolute value equal to 1 means that the number inside is 1 or .

If \dfrac{m - \frac{1}{2}}{1 + \frac{1}{2}m} = 1, then m - \dfrac{1}{2} = 1 + \dfrac{m}{2}, so m = .

If \dfrac{m - \frac{1}{2}}{1 + \frac{1}{2}m} = -1, then m - \dfrac{1}{2} = -1 - \dfrac{m}{2}, so m = .

So the other line has slope 3 or -\dfrac{1}{3}. Why two answers? Fig 9.7 shows it.

Starting from the blue line of slope ½, one of the green lines is turned 45° anticlockwise and the other 45° clockwise. Both make the same 45° angle with it.

Example 3 : The line through the points (-2, 6) and (4, 8) is perpendicular to the line through the points (8, 12) and (x, 24). Find the value of x.

Solution : The slope of the first line is m_1 = \dfrac{8 - 6}{4 - (-2)} = \dfrac{2}{6} = .

The slope of the second line is m_2 = \dfrac{24 - 12}{x - 8} = \dfrac{12}{x - 8}.

The lines are perpendicular, so m_1 m_2 = :

\dfrac{1}{3} \times \dfrac{12}{x - 8} = -1 \;\Rightarrow\; \dfrac{4}{x - 8} = -1 \;\Rightarrow\; x - 8 = -4, so x = .

Speed Round: Parallel, Perpendicular or Neither?

Two slopes appear. Equal means parallel; a product of −1 means perpendicular; anything else means neither. Careful — some slopes are not in lowest terms, and some are only nearly negative reciprocals.

Get five right to move on.

Sina