Skip to main content
\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)
International Baccalaureate · MYP 4

Coordinate Geometry and Straight Lines

⌚ ~154 min ▢ 17 blocks ✓ 82 exercises ➣ Prerequisites : Straight-Line Graphs, Pythagoras' Theorem, Radicals and Surds
I Segments in the Coordinate Plane
I.1 The Gradient Formula
Definition — Gradient
The gradient (also called the slope) of a non-vertical line is defined as the ratio of the change in the vertical direction (\(\Delta y\)) to the change in the horizontal direction (\(\Delta x\)), for any two distinct points on the line. This ratio is the same no matter which two points on the line we choose:$$\text{gradient} = \dfrac{\textcolor{colorprop}{\Delta y}}{\textcolor{colordef}{\Delta x}} = \dfrac{\textcolor{colorprop}{\text{vertical change}}}{\textcolor{colordef}{\text{horizontal change}}}, \quad \text{where } \textcolor{colordef}{\Delta x} \neq 0$$
Figure
For a vertical line, the horizontal change \(\Delta x\) is always zero, so the gradient is undefined.
In the special case where \(x\) increases by exactly \(1\) — that is, \(\Delta x = 1\) — the gradient is simply \(\Delta y\): the gradient tells how much \(y\) changes for one unit step in \(x\).
Figure
Proposition — Gradient Formula
The gradient (also called the slope) of a non-vertical line passing through two distinct points \(A\left(\textcolor{colordef}{x_A}, \textcolor{colorprop}{y_A}\right)\) and \(B\left(\textcolor{colordef}{x_B}, \textcolor{colorprop}{y_B}\right)\) is given by the formula:$$\text{gradient} =\frac{\textcolor{colorprop}{y_B}-\textcolor{colorprop}{y_A}}{\textcolor{colordef}{x_B}-\textcolor{colordef}{x_A}}, \quad \text{where } \textcolor{colordef}{x_A} \neq \textcolor{colordef}{x_B}$$ The order of the points does not matter, as long as we subtract in the same order in the numerator and the denominator.
Figure
Example
Find the gradient of the line \(\Line{AB}\) for \(A\left(\textcolor{colordef}{1}, \textcolor{colorprop}{2}\right)\) and \(B\left(\textcolor{colordef}{5}, \textcolor{colorprop}{4}\right)\).

Figure
$$\begin{aligned}[t]\text{gradient of }\Line{AB} &= \frac{\textcolor{colorprop}{y_B}-\textcolor{colorprop}{y_A}}{\textcolor{colordef}{x_B}-\textcolor{colordef}{x_A}} \\ &= \frac{\textcolor{colorprop}{4}-\textcolor{colorprop}{2}}{\textcolor{colordef}{5}-\textcolor{colordef}{1}} \\ &= \frac{\textcolor{colorprop}{2}}{\textcolor{colordef}{4}} \\ &= \frac{\textcolor{colorprop}{1}}{\textcolor{colordef}{2}}\end{aligned}$$

Skills to practice
  • Calculating Gradients
I.2 Distance and Midpoint

A coast is mapped on squared paper, one unit standing for \(1\) km. A lighthouse stands at \(L(1, 2)\) and a boat is at \(B(7, 10)\). How far is the boat from the lighthouse? Measuring on the map only gives an approximate value: compute the exact distance.

Go from \(L\) horizontally to the point \(C(7, 2)\), then vertically up to \(B\). The grid lines are perpendicular, so the triangle \(LCB\) is right-angled at \(C\), with legs \(LC = 7 - 1 = 6\) and \(CB = 10 - 2 = 8\).
Figure
$$\begin{aligned}[t] LB^2 &= LC^2 + CB^2 && \text{(Pythagoras' theorem in } LCB\text{)} \\ &= 6^2 + 8^2 \\ &= 36 + 64 \\ &= 100. \end{aligned}$$ So \(LB = \sqrt{100} = 10\): the boat is \(10\) km from the lighthouse. The two legs are differences of coordinates: \(7 - 1\) for the \(x\)-coordinates, \(10 - 2\) for the \(y\)-coordinates.


Proposition — Distance Between Two Points in the Plane
In a coordinate plane whose axes are perpendicular and have the same unit, the distance between the points \(A(x_A, y_A)\) and \(B(x_B, y_B)\) is $$AB = \sqrt{(x_B - x_A)^2 + (y_B - y_A)^2}.$$
Figure

Let \(C\) be the point \((x_B, y_A)\): it has the \(y\)-coordinate of \(A\) and the \(x\)-coordinate of \(B\). The segment \(\Segment{AC}\) is horizontal and the segment \(\Segment{CB}\) is vertical; the axes are perpendicular, so the triangle \(ACB\) is right-angled at \(C\).
The length \(AC\) is the difference between the larger and the smaller of the numbers \(x_A\) and \(x_B\): it is \(x_B - x_A\) or its opposite \(x_A - x_B\). A number and its opposite have the same square, so in both cases \(AC^2 = (x_B - x_A)^2\). In the same way, \(CB^2 = (y_B - y_A)^2\). Then $$\begin{aligned}[t] AB^2 &= AC^2 + CB^2 && \text{(Pythagoras' theorem in } ACB\text{)} \\ &= (x_B - x_A)^2 + (y_B - y_A)^2, \end{aligned}$$ and \(AB\), a length, is the square root of this sum. When \(A\) and \(B\) lie on the same horizontal or vertical line, \(C\) is \(B\) or \(A\) and there is no triangle; but then one of the two squares is \(0\), and the formula gives the length \(AB\) directly.

Method — Calculating the Distance Between Two Points
  1. Compute the two differences \(x_B - x_A\) and \(y_B - y_A\) — the order of the two points does not matter, since a difference and its opposite have the same square.
  2. Square each difference and add the two squares.
  3. Take the square root: give the exact value, in simplest form — the largest square factor taken out of the root, as in \(\sqrt{27} = \sqrt{9 \times 3} = 3\sqrt{3}\) — then a rounded value if one is asked for.
Example
Calculate each distance; give the exact value, then a value rounded to \(0.01\) when it is not a whole number.
  1. \(AB\), with \(A(-2, 1)\) and \(B(4, -1)\).
  2. \(CD\), with \(C(3, -2)\) and \(D(3, 5)\).

  1. $$\begin{aligned}[t] AB &= \sqrt{(x_B - x_A)^2 + (y_B - y_A)^2} && \text{(distance formula)} \\ &= \sqrt{(4 - (-2))^2 + (-1 - 1)^2} \\ &= \sqrt{6^2 + (-2)^2} \\ &= \sqrt{36 + 4} \\ &= \sqrt{40} \\ &= \sqrt{4 \times 10} = 2\sqrt{10}. && \text{(simplest form)} \end{aligned}$$ So \(AB = 2\sqrt{10} \approx 6.32\).
  2. $$\begin{aligned}[t] CD &= \sqrt{(3 - 3)^2 + (5 - (-2))^2} && \text{(distance formula)} \\ &= \sqrt{0 + 49} \\ &= 7. \end{aligned}$$ \(C\) and \(D\) lie on the same vertical line: \(CD\) is simply the difference of their \(y\)-coordinates, \(5 - (-2) = 7\).

Method — Classifying a Triangle from Its Vertices
  1. Compute the squares \(AB^2\), \(BC^2\) and \(AC^2\) of the three sides with the distance formula. Lengths are positive, so two lengths are equal exactly when their squares are equal: the square roots are not needed.
  2. Compare the sides: three equal sides, the triangle is equilateral (and so also isosceles); exactly two, it is isosceles and not equilateral; none, it is scalene.
  3. Test a longest side, of length \(c\), the other two being \(a\) and \(b\): if \(a^2 + b^2 = c^2\), the triangle is right-angled, and the right angle is opposite the longest side (converse of Pythagoras' theorem); if \(a^2 + b^2 \neq c^2\), it is not right-angled (contrapositive of Pythagoras' theorem).
Example
Determine the nature of each triangle.
  1. The triangle \(ABC\), with \(A(1, 1)\), \(B(5, 3)\) and \(C(3, 7)\).
  2. The triangle \(PQR\), with \(P(0, 0)\), \(Q(4, 1)\) and \(R(1, 3)\).

  1. With the distance formula: $$\begin{aligned}[t] AB^2 &= (5 - 1)^2 + (3 - 1)^2 = 16 + 4 = 20, \\ BC^2 &= (3 - 5)^2 + (7 - 3)^2 = 4 + 16 = 20, \\ AC^2 &= (3 - 1)^2 + (7 - 1)^2 = 4 + 36 = 40. \end{aligned}$$ \(AB = BC\): the triangle is isosceles, with apex \(B\). The longest side is \(\Segment{AC}\), and \(AB^2 + BC^2 = 20 + 20 = 40 = AC^2\): by the converse of Pythagoras' theorem, the triangle is right-angled at \(B\), the vertex opposite \(\Segment{AC}\). \(ABC\) is an isosceles right-angled triangle.
    Figure
  2. $$\begin{aligned}[t] PQ^2 &= (4 - 0)^2 + (1 - 0)^2 = 17, \\ QR^2 &= (1 - 4)^2 + (3 - 1)^2 = 9 + 4 = 13, \\ PR^2 &= (1 - 0)^2 + (3 - 0)^2 = 1 + 9 = 10. \end{aligned}$$ The three lengths are different: the triangle is scalene. The longest side is \(\Segment{PQ}\), and \(QR^2 + PR^2 = 13 + 10 = 23 \neq 17 = PQ^2\): by the contrapositive of Pythagoras' theorem, \(PQR\) is not right-angled.

Method — Proving a Property with Coordinates
  1. Sketch the figure from the coordinates, to see what is to be proved — a sketch suggests, it does not prove.
  2. Compute the lengths that the property needs, or their squares, with the distance formula.
  3. Conclude by naming the definition or the property used, for example: a quadrilateral with four equal sides is a rhombus, by the definition of a rhombus; a non-crossed quadrilateral whose opposite sides are equal in pairs is a parallelogram; a point \(M\) with \(MA = MB\) lies on the perpendicular bisector of \(\Segment{AB}\), the set of the points at the same distance from \(A\) and from \(B\).
Example
Let \(A(1, 1)\), \(B(2, 4)\), \(C(5, 5)\) and \(D(4, 2)\).
  1. Prove that \(ABCD\) is a rhombus.
  2. Is \(ABCD\) a square?

Figure
  1. With the distance formula: $$\begin{aligned}[t] AB^2 &= (2 - 1)^2 + (4 - 1)^2 = 1 + 9 = 10, \\ BC^2 &= (5 - 2)^2 + (5 - 4)^2 = 9 + 1 = 10, \\ CD^2 &= (4 - 5)^2 + (2 - 5)^2 = 1 + 9 = 10, \\ DA^2 &= (1 - 4)^2 + (1 - 2)^2 = 9 + 1 = 10. \end{aligned}$$ The four sides measure \(\sqrt{10}\): \(ABCD\) has four equal sides, so it is a rhombus, by the definition of a rhombus.
  2. \(AC^2 = (5 - 1)^2 + (5 - 1)^2 = 32\) and \(BD^2 = (4 - 2)^2 + (2 - 4)^2 = 8\): the diagonals do not have the same length. The diagonals of a square have the same length, so \(ABCD\) is not a square.

Definition — Midpoint Formula
The midpoint \(M\) of the segment \(\Segment{AB}\), with \(A(x_A, y_A)\) and \(B(x_B, y_B)\), has coordinates $$M\left(\frac{x_A + x_B}{2},\ \frac{y_A + y_B}{2}\right):$$ each coordinate of \(M\) is the mean of the corresponding coordinates of \(A\) and \(B\).
Figure
Skills to practice
  • Recognising Distances and Triangles
  • Calculating Distances
  • Finding Midpoints and Endpoints
  • Justifying with Distances and Midpoints
  • Proving with Coordinates
II Equations of Lines
II.1 Forms of the Equation of a Line
Definition — Gradient-Intercept Form
The gradient-intercept form (also called the slope-intercept form) of a non-vertical line's equation is:$$y = mx + c$$ where \(m\) is the gradient (also called the slope) and \(c\) is the \(y\)-intercept.
  • The gradient \(m\) tells us how much \(y\) changes when \(x\) increases by \(1\).
  • The \(y\)-intercept \(c\) is the value of \(y\) when \(x = 0\): the line crosses the \(y\)-axis at the point \((0, c)\).
A line equation and a function are two views of the same object: the line \(y = mx + c\) is the graph of a linear function, written \(f(x) = ax + b\): the gradient \(m\) corresponds to \(a\), and the \(y\)-intercept \(c\) to \(b\).
Report an error
Proposition — Horizontal and Vertical Lines
Let \(c\) and \(k\) be two numbers.
  • The horizontal line through the point \((0, c)\) has the equation \(y = c\): its points are exactly the points with \(y\)-coordinate \(c\). It is the line \(y = 0x + c\): its gradient is \(0\) and its \(y\)-intercept is \(c\).
  • The vertical line through the point \((k, 0)\) has the equation \(x = k\): its points are exactly the points with \(x\)-coordinate \(k\). It has no equation of the form \(y = mx + c\), and its gradient is undefined.
In particular, the \(x\)-axis has the equation \(y = 0\) and the \(y\)-axis has the equation \(x = 0\).
Figure

A point \(M(x, y)\) lies on the horizontal line through \((0, c)\) exactly when it is at the same height as \((0, c)\), that is when \(y = c\), whatever its \(x\)-coordinate. So \(y = c\) is true for every point of this line and only for them: it is the equation of the line. Written \(y = 0x + c\), it has the form \(y = mx + c\) with \(m = 0\) and \(c\) as \(y\)-intercept: when \(x\) increases by \(1\), \(y\) does not change.
In the same way, \(M(x, y)\) lies on the vertical line through \((k, 0)\) exactly when \(x = k\), whatever its \(y\)-coordinate: \(x = k\) is its equation. This line contains the points \((k, 0)\) and \((k, 1)\), which have the same \(x\)-coordinate and different \(y\)-coordinates, while an equation \(y = mx + c\) gives only one value of \(y\) for each value of \(x\): no equation of this form describes the line. Along it, \(x\) never increases, so no gradient can be measured.

Definition — General Form of Equation of a Line
The general form of the equation of a line is:$$ax + by = d$$ where \(a\), \(b\), and \(d\) are constants, and \(a\) and \(b\) are not both zero.
  • If \(b \neq 0\), solving for \(y\) gives \(y = -\dfrac{a}{b}x + \dfrac{d}{b}\): the line is not vertical, and its gradient is \(-\dfrac{a}{b}\).
  • If \(b = 0\), then \(a \neq 0\) and the equation becomes \(x = \dfrac{d}{a}\): the line is vertical.
Definition — Point-Gradient Form
A line with gradient \(m\) passing through the point \((x_1, y_1)\) has the equation $$y - y_1 = m(x - x_1),$$ called its point-gradient form (also called the point-slope form). It is the gradient formula in disguise: a point \((x, y)\) with \(x \neq x_1\) lies on the line exactly when \(\dfrac{y - y_1}{x - x_1} = m\).
Example
Find the equation of the line with gradient \(2\) passing through \(A(3, 1)\).

$$\begin{aligned}[t] y - 1 &= 2(x - 3) && \text{(point-gradient form with } m=2, \ (x_1,y_1)=(3,1)\text{)} \\ y - 1 &= 2x - 6 && \text{(expand)} \\ y &= 2x - 5. \end{aligned}$$ For a line through two points, first compute the gradient with the gradient formula, then use the point-gradient form with either of the two points.

Skills to practice
  • Writing the Function of a Line
  • Reading the Gradient and the y-Intercept
  • Rewriting Equations in Gradient-Intercept Form
  • Finding the Equation of a Line through a Point
  • Finding the Equation from Two Points
  • Writing and Plotting Equations of Lines
II.2 Parallel and Perpendicular Lines
Proposition — Parallel Lines
Two distinct, non-vertical lines$$L_1 : y = m_1 x + c_1 \quad \text{and} \quad L_2 : y = m_2 x + c_2$$ are parallel if and only if they have the same gradient (also called slope), i.e.\ \(m_1 = m_2\). (If \(m_1 = m_2\) and \(c_1 = c_2\), the two equations represent the same line — which is why the proposition assumes the lines are distinct.)
All vertical lines (of the form \(x = k\)) are parallel to each other.
Figure
Proposition — Perpendicular Lines
In a coordinate plane whose axes are perpendicular and have the same unit, two non-vertical lines are perpendicular if and only if the product of their gradients \(m_1\) and \(m_2\) is \(-1\), i.e.\ \(m_1 \cdot m_2 = -1\). Equivalently, their gradients are negative reciprocals:$$m_2 = -\frac{1}{m_1}.$$ Additionally, a vertical line (undefined gradient) is always perpendicular to a horizontal line (gradient \(0\)).
Figure

Let \(\ell_1\) have gradient \(m_1 \neq 0\) (when \(m_1 = 0\), \(\ell_1\) is horizontal and the lines perpendicular to it are vertical, with no gradient), and let \(O\) be a point of \(\ell_1\). Its gradient triangle at \(O\) goes \(1\) across and \(m_1\) up, ending at a point \(P\) of \(\ell_1\).
Rotate this triangle a quarter-turn about \(O\). The rotation sends \(\ell_1\) to the line \(\ell_2\) perpendicular to \(\ell_1\) at \(O\), so the image of \(P\) is a point \(P'\) of \(\ell_2\) — and the sides of the triangle swap roles: the run of length \(1\) becomes a rise of \(1\), and the signed rise \(m_1\) becomes a signed run of \(-m_1\). Reading the rotated triangle as a gradient triangle of \(\ell_2\): $$m_2 = \frac{\text{rise}}{\text{run}} = \frac{1}{-m_1}, \qquad \text{so} \qquad m_1 \cdot m_2 = -1.$$ Conversely, if \(m_1 m_2 = -1\), then \(m_2 = -\frac{1}{m_1}\) is the gradient of the perpendicular to \(\ell_1\): a line with this gradient is parallel to that perpendicular, hence itself perpendicular to \(\ell_1\).
Figure

Example
Determine whether the lines \(y=3x+2\) and \(y=3x-1\) are parallel, perpendicular, or neither.

Both lines have gradient \(m=3\), so they are parallel (and distinct, since \(2 \neq -1\)).

Example
Determine whether the lines \(y=4x-3\) and \(y=-\frac{1}{4}x+5\) are parallel, perpendicular, or neither.

The gradients are \(m_1=4\) and \(m_2=-\dfrac{1}{4}\), and \(4 \times \left(-\dfrac{1}{4}\right) = -1\), so they are perpendicular.

Skills to practice
  • Deciding Whether Lines Are Parallel or Perpendicular
  • Finding the Equation of a Parallel or Perpendicular Line
III Going further
Skills to practice
  • Reasoning with Gradients and Distances
  • Investigating Patterns with Distances and Gradients
  • Solving Real-Life Problems with Distances and Gradients
  • Quiz