Sub topic 1
The Cartesian plane: coordinates, axes, and quadrants
Prerequisites
This chapter assumes you can work with fractions and square roots, solve linear equations in two variables, and apply the Pythagorean theorem. You should also know the basic properties of triangles.
Coordinates, axes, and quadrants
Each point in the plane has an ordered pair (x, y). The horizontal axis is the x-axis, and the vertical axis is the y-axis. They meet at the origin (0, 0). The axes split the plane into four quadrants, numbered I to IV counterclockwise from the upper right.
The distance formula and what it proves
The distance between P(x1, y1) and Q(x2, y2) is the square root of (x2 - x1)² + (y2 - y1)². The formula comes from the Pythagorean theorem applied to the horizontal and vertical legs. Equal side lengths confirm an isosceles or equilateral triangle. A right angle is confirmed when the squared sides satisfy a² + b² = c².
def distance(p, q):
return ((p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2) ** 0.5
print(distance((0, 0), (3, 4)))Output: 5.0
Midpoints and the section formula
The point that divides segment AB internally in the ratio m:n is ((n·x1 + m·x2)/(m+n), (n·y1 + m·y2)/(m+n)). A midpoint is the case m:n = 1:1.
def section_point(a, b, m, n):
return ((n * a[0] + m * b[0]) / (m + n),
(n * a[1] + m * b[1]) / (m + n))
print(section_point((1, 2), (7, 8), 1, 2))Output: (3.0, 4.0), one third of the way from A to B.
Slope and collinearity
The slope of the line through (x1, y1) and (x2, y2) is (y2 - y1)/(x2 - x1). Points are collinear when they lie on one line. Comparing slopes requires a division, which fails for a vertical line. The cross-product test avoids this.
| Quantity | Formula |
|---|---|
| Slope of AB | (y2 - y1)/(x2 - x1), when x2 ≠ x1 |
| Collinear test for P, Q, R | (xQ - xP)(yR - yP) = (yQ - yP)(xR - xP) |
def collinear(p, q, r):
return (q[0] - p[0]) * (r[1] - p[1]) == (q[1] - p[1]) * (r[0] - p[0])
print(collinear((0, 0), (1, 2), (2, 4)))
print(collinear((0, 0), (1, 2), (2, 5)))Output: True, then False.
Exercise
Are A(1, 1), B(3, 5), and C(5, 9) collinear?
Show answer
Yes. Slope AB = 4/2 = 2 and slope BC = 4/2 = 2. The cross-product test gives (3 - 1)(9 - 1) = 16 and (5 - 1)(5 - 1) = 16, which are equal.