Skip to content

Chapter 1 — Fundamental Concepts

1.10 — Lines

All the geometry of a line is stored in a single number: how much it rises for each step it advances.


The chapter ends its technical journey with the simplest object of the analytic geometry of §1.8, and for that very reason the most fundamental: the line. All the geometric information of a non-vertical line fits into a single number, its slope. Starting from that number, this section builds the different ways of writing the equation of a line and proves the conditions for parallelism and perpendicularity between two lines. We will follow the same path as with distance in §1.8: we start from Euclidean geometry, translate it into an algebraic definition and, from there on, prove everything with algebra.

Given two points P1=(x1,y1)P_1 = (x_1, y_1) and P2=(x2,y2)P_2 = (x_2, y_2) with x1≠x2x_1 \neq x_2, their slope is

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

the quotient of how much yy changes and how much xx changes in going from one point to the other. The condition x1≠x2x_1 \neq x_2 ensures that the denominator is not zero. The order of the points does not matter: swapping them changes the sign of the numerator and the denominator at the same time, and the quotient stays the same. If m>0m > 0, moving to the right means going up; if m<0m < 0, going down; if m=0m = 0, the two points are at the same height.

A line with two points P1 and P2, the horizontal segment (run) and the vertical one (rise) forming a right angle, illustrating m as their quotient

Figure 1.6 — Slope as the quotient of the rise, y2−y1y_2 - y_1, and the run, x2−x1x_2 - x_1.

Why is this the number that describes a line? Euclidean geometry answers as follows. If P1P_1, P2P_2 and P3P_3 are three points of the same non-vertical line, we draw horizontal and vertical segments from them, as in the proof in §1.8. Two right triangles are formed, one with hypotenuse P1P2P_1P_2 and the other with hypotenuse P1P3P_1P_3, which have the same acute angle at P1P_1 because the three points are aligned. Two right triangles with an equal acute angle are similar, and their legs are proportional, so that ∣y2−y1∣∣x2−x1∣=∣y3−y1∣∣x3−x1∣\frac{|y_2 - y_1|}{|x_2 - x_1|} = \frac{|y_3 - y_1|}{|x_3 - x_1|}. The signs also agree, because along a line one always goes up, or always goes down, when moving to the right. The slope computed with any two points of a line is the same.

As we did with distance, from here on we adopt the algebraic consequence of this fact as a definition. Let us fix a point (0,b)(0, b) of the line on the yy-axis. A point (x,y)(x, y) with x≠0x \neq 0 lies on the line exactly when the slope between (0,b)(0, b) and (x,y)(x, y) is mm, that is, when y−bx=m\frac{y - b}{x} = m, or y=mx+by = mx + b; and for x=0x = 0 this equation gives (0,b)(0, b) itself. That is why we call the non-vertical line with slope mm and yy-intercept bb the curve, in the sense of §1.8, formed by the points that satisfy

y=mx+by = mx + b

and the vertical line the curve formed by the points that satisfy x=cx = c, for a fixed real number cc. With this definition, the geometric fact becomes an algebraic theorem.

Proposition. If (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) are two distinct points of the line y=mx+by = mx + b, then y2−y1x2−x1=m\dfrac{y_2 - y_1}{x_2 - x_1} = m.

Proof. If x1=x2x_1 = x_2, then y1=mx1+b=mx2+b=y2y_1 = mx_1 + b = mx_2 + b = y_2 and the points would be equal; therefore x1≠x2x_1 \neq x_2. Moreover y2−y1=(mx2+b)−(mx1+b)=m(x2−x1)y_2 - y_1 = (mx_2 + b) - (mx_1 + b) = m(x_2 - x_1), and dividing by x2−x1≠0x_2 - x_1 \neq 0 gives the equality. ■\blacksquare

This proposition is what authorizes us to speak of “the” slope of a line, and not of a slope that depends on the two points chosen.


A non-vertical line is determined by its slope and one of its points.

Proposition (point-slope form). The line with slope mm passing through (x1,y1)(x_1, y_1) is the graph of

y−y1=m(x−x1)y - y_1 = m(x - x_1)

Proof. The line y=mx+by = mx + b passes through (x1,y1)(x_1, y_1) if and only if y1=mx1+by_1 = mx_1 + b, that is, if and only if b=y1−mx1b = y_1 - mx_1. There is, then, exactly one line with slope mm passing through that point, the one with equation y=mx+y1−mx1y = mx + y_1 - mx_1, and that equation is equivalent to y−y1=m(x−x1)y - y_1 = m(x - x_1), because one passes from one to the other by adding −y1-y_1 to both sides. ■\blacksquare

When the known point is the intersection with the yy-axis, (0,b)(0, b), the point-slope form gives y−b=m(x−0)y - b = m(x - 0), which is the slope-intercept form y=mx+by = mx + b. They are the same line, presented from different data; which one is more convenient depends on what information is at hand.

A line is also determined by two of its points.

Proposition (line through two points). Through two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) with x1≠x2x_1 \neq x_2 passes exactly one non-vertical line, the one with slope m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1} passing through (x1,y1)(x_1, y_1).

Proof. If a non-vertical line passes through the two points, by the proposition of §1 its slope is necessarily m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}, and by the previous proposition it is the only line with that slope passing through (x1,y1)(x_1, y_1). Conversely, that line passes through (x1,y1)(x_1, y_1), and also through (x2,y2)(x_2, y_2), because y1+m(x2−x1)=y1+(y2−y1)=y2y_1 + m(x_2 - x_1) = y_1 + (y_2 - y_1) = y_2. ■\blacksquare

Example. The line through (1,3)(1, 3) and (4,−3)(4, -3) has slope m=−3−34−1=−2m = \frac{-3 - 3}{4 - 1} = -2, and its equation is y−3=−2(x−1)y - 3 = -2(x - 1), that is, y=−2x+5y = -2x + 5. Let us check with the second point: −2⋅4+5=−3-2 \cdot 4 + 5 = -3.

If x1=x2x_1 = x_2 and the points are distinct, no non-vertical line passes through both, because an equation y=mx+by = mx + b assigns a single value of yy to each xx. The only line containing them is the vertical line x=x1x = x_1.


Two distinct lines are parallel when they have no point in common. With the algebraic definition of §1, parallelism can be proved instead of assumed.

Proposition. Two distinct non-vertical lines, y=m1x+b1y = m_1x + b_1 and y=m2x+b2y = m_2x + b_2, are parallel if and only if m1=m2m_1 = m_2. If m1≠m2m_1 \neq m_2, they meet at exactly one point.

Proof. A point (x,y)(x, y) lies on both lines if and only if y=m1x+b1y = m_1x + b_1 and y=m2x+b2y = m_2x + b_2, which happens exactly when xx is a solution of m1x+b1=m2x+b2m_1x + b_1 = m_2x + b_2 and y=m1x+b1y = m_1x + b_1. That equation is equivalent to (m1−m2)x=b2−b1(m_1 - m_2)x = b_2 - b_1, which is linear in the sense of §1.5. If m1≠m2m_1 \neq m_2, it has a unique solution, x=b2−b1m1−m2x = \frac{b_2 - b_1}{m_1 - m_2}, and the lines meet at a single point. If m1=m2m_1 = m_2, then b1≠b2b_1 \neq b_2, because the lines are distinct, and the equation reduces to 0=b2−b10 = b_2 - b_1, which is false: there are no common points. ■\blacksquare

Likewise, two distinct vertical lines, x=c1x = c_1 and x=c2x = c_2, are parallel, and a non-vertical line meets a vertical line x=cx = c at exactly one point, (c,mc+b)(c, mc + b).

Perpendicularity again requires a link with Euclidean geometry, the same one as in §1.8: the Pythagorean theorem and its converse, which say that a triangle has a right angle at a vertex if and only if the square of the side opposite that vertex is the sum of the squares of the other two.

Proposition. Two non-vertical lines, with slopes m1m_1 and m2m_2, are perpendicular if and only if m1m2=−1m_1 m_2 = -1.

Proof. If m1m2=−1m_1 m_2 = -1, then m1≠m2m_1 \neq m_2, because m12=−1m_1^2 = -1 is impossible; and if the lines are perpendicular, they meet. In both cases, by the previous proposition, the lines meet at a single point P0=(x0,y0)P_0 = (x_0, y_0). By the point-slope form, the points A=(x0+1,y0+m1)A = (x_0 + 1, y_0 + m_1) and B=(x0+1,y0+m2)B = (x_0 + 1, y_0 + m_2) lie on the first and the second line, respectively, and are distinct from P0P_0. The lines are perpendicular if and only if the triangle P0ABP_0AB has a right angle at P0P_0, that is, by Pythagoras and its converse, if and only if

d(A,B)2=d(P0,A)2+d(P0,B)2d(A, B)^2 = d(P_0, A)^2 + d(P_0, B)^2

By the formula of §1.8, d(P0,A)2=1+m12d(P_0, A)^2 = 1 + m_1^2, d(P0,B)2=1+m22d(P_0, B)^2 = 1 + m_2^2 and d(A,B)2=(m2−m1)2=m12−2m1m2+m22d(A, B)^2 = (m_2 - m_1)^2 = m_1^2 - 2m_1m_2 + m_2^2. The condition becomes

m12−2m1m2+m22=2+m12+m22⟺−2m1m2=2⟺m1m2=−1m_1^2 - 2m_1m_2 + m_2^2 = 2 + m_1^2 + m_2^2 \quad\Longleftrightarrow\quad -2m_1m_2 = 2 \quad\Longleftrightarrow\quad m_1m_2 = -1

where each step is an equivalence, because one passes from one equation to the next by adding the same term or multiplying by a nonzero number (§1.5). ■\blacksquare

The condition m1m2=−1m_1 m_2 = -1 is also written m2=−1m1m_2 = -\frac{1}{m_1}: each slope is the negative of the reciprocal of the other. The case the formula does not cover is that of a horizontal line, with slope 00, and a vertical one, which has no slope; those two lines are also perpendicular.

This proof shows, in condensed form, the program of analytic geometry: a geometric condition, that two lines form a right angle, is translated into an algebraic condition on two numbers, that their product be −1-1.

Panel with two parallel lines of equal slope on the left, and two perpendicular lines whose slopes multiply to -1 on the right, with the right angle marked

Figure 1.7 — Parallel lines (m1=m2m_1=m_2) and perpendicular lines (m1m2=−1m_1m_2=-1).


The forms of §2 do not work for vertical lines, which have no slope. There is a form of equation that covers all lines without exception.

Proposition (general form). Every line in the plane is the graph of an equation

Ax+By+C=0Ax + By + C = 0

with AA and BB not both zero. Conversely, every equation of that form has a line as its graph.

Proof. The line y=mx+by = mx + b is the graph of mx−y+b=0mx - y + b = 0, which has that form with A=mA = m, B=−1B = -1 and C=bC = b; the vertical line x=cx = c is the graph of x−c=0x - c = 0, with A=1A = 1, B=0B = 0 and C=−cC = -c. Conversely, suppose Ax+By+C=0Ax + By + C = 0 with AA and BB not both zero. If B≠0B \neq 0, the equation is equivalent to y=−ABx−CBy = -\frac{A}{B}x - \frac{C}{B}, the line with slope −AB-\frac{A}{B} and yy-intercept −CB-\frac{C}{B}. If B=0B = 0, then A≠0A \neq 0, and the equation is equivalent to x=−CAx = -\frac{C}{A}, a vertical line. ■\blacksquare

The general form is not unique: multiplying the equation by a nonzero number gives another equivalent equation, with the same graph. Thus 2x−y+3=02x - y + 3 = 0 and −4x+2y−6=0-4x + 2y - 6 = 0 describe the same line, y=2x+3y = 2x + 3.


With the line, the technical journey of the chapter is complete: the real numbers, their powers and roots, algebraic and fractional expressions, equations and inequalities, and the analytic geometry that carries them into the plane. The next section closes the chapter with an overall view.