Sub topic 7
Points that lie on an axis
What this chapter assumes
You should already know how to plot an ordered pair (x, y), how the x-axis and y-axis cross at the origin, and how the signs of the coordinates place a point in one of the four quadrants. You should also be comfortable with positive and negative numbers. This chapter covers the points that the quadrant rules leave out: points that sit on an axis.
Why axis points need their own rule
The four quadrants cover the open regions of the plane. The axes themselves belong to none of them. A point such as (0, 7) has an x-coordinate that is neither positive nor negative, so the sign rules for quadrants do not apply to it.
This matters in practice. A common error is to call (0, 7) "in quadrant I" or "in quadrant II" because the 7 is positive. The point is on the y-axis, and it has no quadrant.
The two defining rules
A point lies on an axis when one of its coordinates is zero.
- A point on the x-axis has the form (x, 0). Its y-coordinate is 0, so it is neither above nor below the x-axis. Examples: (5, 0), (-3, 0), (0.5, 0).
- A point on the y-axis has the form (0, y). Its x-coordinate is 0, so it is neither left nor right of the y-axis. Examples: (0, 4), (0, -9), (0, 2.5).
The easy way to remember which is which: the coordinate that is zero is the one that makes no movement away from the axis you are on. To reach (5, 0), you move 5 units along x and then 0 units up or down. You never leave the x-axis.
The origin is on both axes
The origin is the point (0, 0). Both coordinates are zero, so it satisfies both rules. It lies on the x-axis and on the y-axis, and it is the only point that does. When you classify a point, check for the origin first. Otherwise a test for "y is zero" will report (0, 0) as an x-axis point and hide the fact that it is also on the y-axis.
Classifying points in code
The classification logic follows the flowchart. The order of the checks matters: the origin test comes first.
def locate(x, y):
if x == 0 and y == 0:
return "origin"
if y == 0:
return "on the x-axis"
if x == 0:
return "on the y-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"
print(locate(3, 2))
print(locate(-4, 5))
print(locate(-1, -6))
print(locate(2, -3))
print(locate(0, 7))The five calls print quadrant I, quadrant II, quadrant III, quadrant IV and on the y-axis. The last call, locate(0, 7), is the axis case. If you moved the y == 0 and x == 0 checks below the quadrant checks, the function would still return something for (0, 7), but it would return quadrant IV, because none of the earlier quadrant tests match and the final line is a fallback. That is a silent wrong answer. Putting the axis tests before the quadrant tests removes the problem.
Plotting axis points
Plotting an axis point follows the same procedure as any other point, but one of the two movements has length zero.
- Start at the origin.
- Move along the x-axis by the x-coordinate. Right if positive, left if negative, not at all if zero.
- Move parallel to the y-axis by the y-coordinate. Up if positive, down if negative, not at all if zero.
- Mark the point.
For (-4, 0), you move 4 units left and 0 units vertically, so the point sits on the x-axis, 4 units left of the origin. For (0, -3), you skip the horizontal move and go 3 units down, so the point sits on the y-axis below the origin.
The following program plots one point in each quadrant plus the origin. The axes are drawn as black lines, and the scale is equal on both axes.
import matplotlib.pyplot as plt
points = [(3, 2), (-4, 5), (-1, -6), (2, -3), (0, 0)]
xs = [p[0] for p in points]
ys = [p[1] for p in points]
fig, ax = plt.subplots()
ax.scatter(xs, ys)
for x, y in points:
ax.annotate(f"({x}, {y})", (x, y), textcoords="offset points", xytext=(5, 5))
ax.axhline(0, color="black")
ax.axvline(0, color="black")
ax.set_xlim(-8, 8)
ax.set_ylim(-8, 8)
ax.set_aspect("equal")
ax.grid(True)
plt.show()The origin appears where the two black lines cross. Notice that none of the other four points touch a black line. If you add (0, 7) and (-5, 0) to the list, they will land on the y-axis line and the x-axis line, and you can see directly that they sit on a boundary between quadrants.
Axis points as boundaries
Each axis is the dividing line between two quadrants.
| Point type | Example | Lies between |
|---|---|---|
| Positive x-axis | (4, 0) | Quadrant I and quadrant IV |
| Negative x-axis | (-4, 0) | Quadrant II and quadrant III |
| Positive y-axis | (0, 4) | Quadrant I and quadrant II |
| Negative y-axis | (0, -4) | Quadrant III and quadrant IV |
| Origin | (0, 0) | All four quadrants meet here |
This boundary view explains a useful fact about reflections, covered in a later chapter. Reflecting a point across the x-axis changes the sign of y. If y is already 0, the sign change does nothing, so a point on the x-axis is its own reflection across the x-axis. The same holds for points on the y-axis and reflection across the y-axis. The code below shows this.
def reflect_x_axis(point):
x, y = point
return (x, -y)
def reflect_y_axis(point):
x, y = point
return (-x, y)
print(reflect_x_axis((5, 0)))
print(reflect_y_axis((0, 4)))
print(reflect_x_axis((0, 4)))The three lines print (5, 0), (0, 4) and (0, -4). The first two points did not move. The third moved, because (0, 4) is on the y-axis but not on the x-axis. Python prints -0 as 0 for integers, so there is no negative zero to worry about here. With floating-point values, -0.0 can appear, and it compares equal to 0.0.
Distance from the origin along an axis
For a point on an axis, the distance to the origin is the absolute value of its one nonzero coordinate.
- (−6, 0) is 6 units from the origin.
- (0, 2.5) is 2.5 units from the origin.
You do not need the distance formula for these. The two coordinates are not both involved, so the vertical or horizontal distance is already the full distance. The general formula gives the same answer: for (−6, 0), the distance is the square root of (−6)² + 0², which is 6.
The same idea extends to two points on the same axis. For (−2, 0) and (5, 0), the distance is |5 − (−2)| = 7. Take care with the subtraction when one value is negative. Subtracting a negative adds, so 5 − (−2) is 7, not 3.
Common mistakes
- Labeling an axis point with a quadrant. (0, 7) and (−3, 0) are on axes, not in quadrants.
- Swapping the axes. (5, 0) is on the x-axis and (0, 5) is on the y-axis. These are different points. Remember that the first number is horizontal.
- Forgetting the origin is on both axes. If a question asks for points on the x-axis from a list, (0, 0) qualifies.
- Treating "zero" as "missing." The point (4, 0) still has a y-coordinate. You must write the zero. Writing (4) or (4, ) does not name a point on the plane.
- Misplacing a point on a scaled axis. If the axis counts by 5s, the point (10, 0) is two tick marks from the origin, not ten.
Summary of the rules
- (x, 0) with x ≠ 0 is on the x-axis only.
- (0, y) with y ≠ 0 is on the y-axis only.
- (0, 0) is on both axes.
- A point with no zero coordinate is in exactly one quadrant.
- Axis points belong to no quadrant.
Exercise
Classify each point as origin, on the x-axis, on the y-axis, or in a quadrant (name it): (0, −8), (6, 0), (−2, −2), (0, 0), (7, −1). Then find the distance between (−3, 0) and (4, 0).
Show answer
(0, −8) is on the y-axis. (6, 0) is on the x-axis. (−2, −2) is in quadrant III. (0, 0) is the origin, on both axes. (7, −1) is in quadrant IV. Both points for the distance are on the x-axis, so the distance is |4 − (−3)| = 7.
Exercise
A student's function checks if x > 0 and y > 0 first, then the other three quadrant tests, and finally return "on an axis". Which input gives a wrong answer for the origin check, and what is the fix?
Show answer
The function returns "on an axis" for (0, 0), which is true but incomplete, since the origin is on both axes and is usually reported separately. It also reports "on an axis" without saying which one. The fix is to test x == 0 and y == 0 first and return "origin". Then test y == 0 for the x-axis and x == 0 for the y-axis before any quadrant test.