Sub topic 1
Points and lines on the coordinate plane
Prerequisites
This chapter assumes you can already do the following:
- Plot a point such as (3, -2) on a grid.
- Add, subtract, and compare signed numbers and simple fractions.
- Substitute a number into an expression such as 2x + 1 and evaluate it.
- Solve one-step and two-step linear equations, such as 2x + 1 = 7.
The rest of the tutorial builds slope and y = mx + b on top of the coordinate plane. This chapter fixes the vocabulary and the habits you need first, so later chapters can focus on the new ideas.
The coordinate plane
The coordinate plane is a flat surface with two number lines that cross at right angles.
- The x-axis is the horizontal number line.
- The y-axis is the vertical number line.
- The origin is the point where the axes cross. Both number lines read 0 there.
Every point on the plane is described by an ordered pair (x, y). The first number tells you how far to move horizontally from the origin. The second tells you how far to move vertically. Positive x moves right and negative x moves left. Positive y moves up and negative y moves down.
The word "ordered" matters. The point (2, 5) and the point (5, 2) are different points. A common slip is to swap the two numbers, so build the habit of reading the pair as "across first, then up or down."
Quadrants
The axes split the plane into four regions called quadrants. They are numbered counterclockwise, starting at the upper right.
| Quadrant | Sign of x | Sign of y | Example |
|---|---|---|---|
| I | positive | positive | (3, 4) |
| II | negative | positive | (-3, 4) |
| III | negative | negative | (-3, -4) |
| IV | positive | negative | (3, -4) |
A point on an axis belongs to no quadrant. The point (0, 5) lies on the y-axis and (-2, 0) lies on the x-axis. The origin (0, 0) lies on both axes. This is the first edge case to remember: a zero coordinate puts the point on an axis, not in a region.
The diagram shows the decision process for locating any point.
The same logic in code looks like this:
def locate(x, y):
if x == 0 and y == 0:
return "origin"
if x == 0:
return "y-axis"
if y == 0:
return "x-axis"
if x > 0 and y > 0:
return "quadrant I"
if x < 0 and y > 0:
return "quadrant II"
if x < 0 and y < 0:
return "quadrant III"
return "quadrant IV"
for point in [(3, 4), (-3, 4), (-3, -4), (3, -4), (0, 5), (-2, 0), (0, 0)]:
print(point, "->", locate(*point))The order of the checks matters. The axis cases come first because a point like (0, 5) would otherwise fall through the sign tests without matching anything.
Distance along a horizontal or vertical direction
When two points share a y-value, they sit on a horizontal line. The distance between them is the absolute value of the difference of their x-values. For (-2, 3) and (4, 3), the distance is |4 - (-2)| = 6.
When two points share an x-value, the same idea applies to the y-values. For (5, -1) and (5, 6), the distance is |6 - (-1)| = 7.
Pay attention to the double negative in the first example. Subtracting a negative number adds, so 4 - (-2) is 6, not 2. Most arithmetic mistakes in later chapters come from this one step.
The subtraction (end - start) also gives a signed change, which is positive when you move right or up and negative when you move left or down. That signed change is the raw material of slope.
Lines as sets of points
A line is a straight path that continues forever in both directions. In algebra, a line is also described as the set of all points (x, y) whose coordinates make a given equation true. The equation acts as a membership test.
Take the equation y = 2x + 1. To find points on its line, pick a value for x and compute y.
| x | 2x + 1 | y | Point |
|---|---|---|---|
| -2 | 2(-2) + 1 | -3 | (-2, -3) |
| -1 | 2(-1) + 1 | -1 | (-1, -1) |
| 0 | 2(0) + 1 | 1 | (0, 1) |
| 1 | 2(1) + 1 | 3 | (1, 3) |
| 2 | 2(2) + 1 | 5 | (2, 5) |
If you plot these five points, they fall on one straight path. Each time x increases by 1, y increases by 2. That constant, predictable change is what makes the graph a line. The next chapters name it the rate of change and then the slope.
Because the line is infinite, the table above shows only a few of its points. Every other point is also on the line. Between (0, 1) and (1, 3), for example, the point (0.5, 2) satisfies 2(0.5) + 1 = 2, so it is on the line too.
Testing whether a point is on a line
To test a point, substitute both coordinates into the equation and check whether the two sides are equal. A single point cannot be "close enough." It either satisfies the equation or it does not.
Is (3, 7) on y = 2x + 1? Substituting gives 7 on the left and 2(3) + 1 = 7 on the right. They match, so the point is on the line.
Is (3, 8) on the line? The left side is 8 and the right side is 7. They differ, so it is not.
When a line is written as Ax + By = C, the test works the same way. The function below uses integer coefficients so that the equality check is exact.
def on_line(point, A, B, C):
x, y = point
return A * x + B * y == C
# The line 2x + 3y = 6
for p in [(0, 2), (3, 0), (-3, 4), (1, 1)]:
print(p, on_line(p, 2, 3, 6))The first three points print True and (1, 1) prints False, because 2(1) + 3(1) = 5, not 6.
Special lines: horizontal and vertical
Two kinds of lines have very short equations.
- A horizontal line has the equation y = k for some constant k. Every point on it has the same y-value. The line y = 3 contains (-4, 3), (0, 3), and (7, 3).
- A vertical line has the equation x = h for some constant h. Every point on it has the same x-value. The line x = -2 contains (-2, -5), (-2, 0), and (-2, 4).
The axes themselves are special cases. The x-axis is the line y = 0, and the y-axis is the line x = 0.
Notice that a vertical line is not the graph of a function of x. Many different y-values share one x-value. This is why the slope formula in a later chapter fails for vertical lines, and why the slope-intercept form y = mx + b cannot describe them. Keep this edge case in mind: it is the only kind of line that y = mx + b misses.
Where a line meets the axes
Two points on any line deserve special attention because they are easy to find.
- The y-intercept is where the line crosses the y-axis. At that point x = 0.
- The x-intercept is where the line crosses the x-axis. At that point y = 0.
To find the y-intercept, set x = 0 and solve for y. To find the x-intercept, set y = 0 and solve for x. For 2x + 3y = 6:
- With x = 0: 3y = 6, so y = 2. The y-intercept is the point (0, 2).
- With y = 0: 2x = 6, so x = 3. The x-intercept is the point (3, 0).
Plotting these two points and drawing the line through them is a quick way to graph a line. Note that an intercept is a point, so it has two coordinates, although people often quote just the nonzero one ("the y-intercept is 2").
from fractions import Fraction
def intercepts(A, B, C):
x_int = Fraction(C, A) if A != 0 else None
y_int = Fraction(C, B) if B != 0 else None
return x_int, y_int
print(intercepts(2, 3, 6)) # (Fraction(3, 1), Fraction(2, 1))
print(intercepts(0, 4, 8)) # (None, Fraction(2, 1))
print(intercepts(5, 0, 10)) # (Fraction(2, 1), None)The second and third calls show the edge cases. A horizontal line (A = 0) never crosses the x-axis, unless it is the x-axis itself. A vertical line (B = 0) never crosses the y-axis, unless it is the y-axis itself. In those cases the function returns None for the missing intercept. A line with C = 0 and both A and B nonzero passes through the origin, so both intercepts are 0.
Common errors
- Swapping coordinates. Plotting (4, 1) as if it were (1, 4). Always move along x first.
- Mishandling negatives. Reading 4 - (-2) as 2 instead of 6.
- Confusing the intercept's value with its location. The y-intercept of y = 2x + 1 is the point (0, 1), not the number 2.
- Assuming a short table of points is the whole line. A line contains infinitely many points, and the table shows a sample.
- Ignoring the scale. Axes do not have to count by ones. If the grid marks go up by 5, a point that appears two squares from the origin has a coordinate of 10.
What comes next
You now have the vocabulary: ordered pairs, axes, quadrants, intercepts, and the idea that a line is the set of points satisfying an equation. The next chapter looks closely at the pattern in the table above, where y changed by the same amount each time x increased by 1. That pattern is the rate of change, and it leads directly to slope.
Exercise
The line 3x - 2y = 12 is given. (a) Is the point (4, 0) on the line? (b) Is the point (2, -3) on the line? (c) Find the x-intercept and the y-intercept as points.
Show answer
(a) Substitute: 3(4) - 2(0) = 12, which equals 12, so (4, 0) is on the line. (b) Substitute: 3(2) - 2(-3) = 6 + 6 = 12, which equals 12, so (2, -3) is on the line. (c) For the x-intercept set y = 0: 3x = 12, so x = 4, giving the point (4, 0). For the y-intercept set x = 0: -2y = 12, so y = -6, giving the point (0, -6).
Exercise
Without plotting, state where each point lies (quadrant, axis, or origin): (-7, 2), (0, -3), (6, -1), (-4, -4), (0, 0). Then give the distance between (-5, 2) and (3, 2).
Show answer
(-7, 2) is in quadrant II. (0, -3) is on the y-axis. (6, -1) is in quadrant IV. (-4, -4) is in quadrant III. (0, 0) is the origin. The points (-5, 2) and (3, 2) share a y-value, so the distance is |3 - (-5)| = 8.