STEMviz
Mathematics · Geometry, Vectors and Statistics

Fundamentals of Analytic Geometry in the Plane

Coordinates, distance, midpoint, gradient, line equations, and parallel/perpendicular conditions in the Cartesian plane.

Fundamentals of Analytic Geometry in the Plane

Analytic geometry turns geometric statements into algebra: a point becomes a pair of numbers, a line becomes an equation, and "do these two lines meet" becomes "solve this system." Every result in this chapter is a tool you will keep using for the rest of the course — the moment vectors appear in the next chapter, they are built on exactly the coordinate machinery developed here.

To follow the chapter you need the Cartesian plane, Pythagoras' theorem, and basic algebraic manipulation of linear equations. Nothing here is new content so much as a new, more powerful language for content you already know.

Coordinates fix a correspondence. The Cartesian plane assigns to every point PP an ordered pair (x,y)(x, y) — the signed distances from PP to two perpendicular axes. Once this correspondence is fixed, every geometric question about points and lines becomes a question about numbers.

1. Distance Between Two Points

Let A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) be two points. Drop a horizontal line through AA and a vertical line through BB; they meet at C(x2,y1)C(x_2, y_1), forming a right triangle with legs ∣AC∣=∣x2−x1∣|AC| = |x_2 - x_1| and ∣CB∣=∣y2−y1∣|CB| = |y_2 - y_1| and hypotenuse ABAB. Pythagoras' theorem gives directly:

∣AB∣=(x2−x1)2+(y2−y1)2|AB| = \sqrt{(x_2 - x_1)^{2} + (y_2 - y_1)^{2}}

Worked example. Find the distance between A(−1,2)A(-1, 2) and B(4,−3)B(4, -3).

∣AB∣=(4−(−1))2+(−3−2)2=25+25=50=52|AB| = \sqrt{(4-(-1))^{2} + (-3-2)^{2}} = \sqrt{25 + 25} = \sqrt{50} = 5\sqrt{2}

2. The Midpoint and the Section Formula

The midpoint MM of segment ABAB has coordinates that are simply the averages of the endpoints:

M=(x1+x22,y1+y22)M = \left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right)

This is a special case of a more general fact. If PP divides ABAB in the ratio AP:PB=m:nAP:PB = m:n (measured along the segment from AA to BB), then

P=(nx1+mx2m+n,ny1+my2m+n)P = \left(\frac{nx_1 + mx_2}{m+n}, \frac{ny_1 + my_2}{m+n}\right)

which reduces to the midpoint formula when m=n=1m = n = 1. The derivation follows from similar triangles: the horizontal run from AA to PP is the same fraction mm+n\frac{m}{m+n} of the total run from AA to BB as the vertical rise is, so xP=x1+mm+n(x2−x1)x_P = x_1 + \frac{m}{m+n}(x_2 - x_1), which rearranges to the formula above (and likewise for yPy_P).

Worked example. Point PP divides A(1,1)A(1, 1) to B(13,7)B(13, 7) in the ratio 2:12:1. Then

P=(1(1)+2(13)3,1(1)+2(7)3)=(273,153)=(9,5)P = \left(\frac{1(1) + 2(13)}{3}, \frac{1(1) + 2(7)}{3}\right) = \left(\frac{27}{3}, \frac{15}{3}\right) = (9, 5)

3. Gradient (Slope) of a Line

The gradient mm of the line through A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) measures steepness as a ratio of rise to run:

m=y2−y1x2−x1,x1≠x2m = \frac{y_2 - y_1}{x_2 - x_1}, \qquad x_1 \neq x_2

The gradient is independent of which two points on the line are chosen — any pair gives the same ratio, since all such pairs form similar right triangles. If the line makes angle θ\theta with the positive xx-axis, then m=tan⁡θm = \tan\theta, which follows directly from the right-triangle definition of tangent applied to the rise-over-run triangle. A horizontal line has m=0m = 0; a vertical line has undefined gradient, since x2−x1=0x_2 - x_1 = 0.

Steepness is not the same as angle. Doubling the gradient does not double the angle of inclination, because tan⁡θ\tan\theta is not linear in θ\theta. A gradient of 11 corresponds to 45°45°, but a gradient of 22 corresponds to about 63.4°63.4°, not 90°90°.

4. Equations of a Straight Line

A line is the set of all points (x,y)(x,y) satisfying one linear equation. Three equivalent forms are used throughout the course:

  • Point-gradient form, built directly from the gradient definition applied to a fixed point (x1,y1)(x_1, y_1) and a variable point (x,y)(x,y) on the line:
y−y1=m(x−x1)y - y_1 = m(x - x_1)
  • Slope-intercept form, obtained by expanding and solving for yy, where cc is the yy-intercept:
y=mx+cy = mx + c
  • General form, useful when the gradient is undefined (vertical lines) or when symmetry between xx and yy is wanted:
ax+by+d=0ax + by + d = 0

Worked example. Find the equation of the line through A(2,−1)A(2, -1) and B(6,7)B(6, 7).

First, m=7−(−1)6−2=84=2m = \dfrac{7-(-1)}{6-2} = \dfrac{8}{4} = 2. Using point-gradient form with AA:

y−(−1)=2(x−2)  ⟹  y=2x−5y - (-1) = 2(x - 2) \implies y = 2x - 5

5. Parallel and Perpendicular Lines

Two non-vertical lines with gradients m1m_1 and m2m_2 are parallel exactly when m1=m2m_1 = m_2 — equal steepness means equal direction. They are perpendicular exactly when

m1m2=−1m_1 m_2 = -1

To see why, rotate a line of gradient m1=tan⁡θm_1 = \tan\theta by 90°90°; the new angle is θ+90°\theta + 90°, and using the identity tan⁡(θ+90°)=−1tan⁡θ\tan(\theta+90°) = -\dfrac{1}{\tan\theta}, the new gradient is −1m1-\dfrac{1}{m_1}. So perpendicular gradients are negative reciprocals of one another.

Worked example — the harder case. Find the equation of the line through C(3,4)C(3,4) perpendicular to the line 2x+3y−6=02x + 3y - 6 = 0.

Rewriting the given line in slope-intercept form: y=−23x+2y = -\dfrac{2}{3}x + 2, so m1=−23m_1 = -\dfrac{2}{3}. The perpendicular gradient satisfies m1m2=−1m_1 m_2 = -1, so m2=32m_2 = \dfrac{3}{2}. Through C(3,4)C(3,4):

y−4=32(x−3)  ⟹  2y−8=3x−9  ⟹  3x−2y−1=0y - 4 = \frac{3}{2}(x-3) \implies 2y - 8 = 3x - 9 \implies 3x - 2y - 1 = 0

This case exposes the edge a careless student misses: forgetting to convert the given equation to slope-intercept form first, and instead reading off m1=2m_1 = 2 or m1=3m_1 = 3 directly from the general-form coefficients — the general form's coefficients are not the gradient.

6. Intersection of Two Lines

Two non-parallel lines meet at exactly one point, found by solving their equations simultaneously.

Worked example. Find the intersection of y=2x−5y = 2x - 5 and 3x−2y−1=03x - 2y - 1 = 0 (the two lines from the previous examples).

Substitute the first into the second: 3x−2(2x−5)−1=0  ⟹  3x−4x+10−1=0  ⟹  −x+9=0  ⟹  x=93x - 2(2x-5) - 1 = 0 \implies 3x - 4x + 10 - 1 = 0 \implies -x + 9 = 0 \implies x = 9. Then y=2(9)−5=13y = 2(9) - 5 = 13. The lines meet at (9,13)(9, 13) — as expected, since their gradients (22 and 32\tfrac32) are unequal, so the lines are non-parallel and must cross at exactly one point (note: this gradient product is 2×32=3≠−12\times\tfrac32=3\neq-1, so the two lines are not perpendicular — they simply happen to share a worked-example equation with the previous section).

7. The Angle Between Two Lines

If two lines have gradients m1m_1 and m2m_2 and meet at angle α\alpha (taken as the acute angle between them), the angle each makes with the xx-axis gives, via the tangent subtraction formula,

tan⁡α=∣m1−m21+m1m2∣\tan\alpha = \left|\frac{m_1 - m_2}{1 + m_1 m_2}\right|

The modulus is needed because swapping which line is "first" would otherwise flip the sign, while the acute angle between two lines is a single, well-defined, positive quantity.

Worked example. Find the acute angle between lines of gradient m1=3m_1 = 3 and m2=−1m_2 = -1.

tan⁡α=∣3−(−1)1+3(−1)∣=∣4−2∣=2  ⟹  α=arctan⁡(2)≈63.4°\tan\alpha = \left|\frac{3-(-1)}{1+3(-1)}\right| = \left|\frac{4}{-2}\right| = 2 \implies \alpha = \arctan(2) \approx 63.4°

Common Exam Pitfalls

  • Reading the gradient off the general form directly. In ax+by+d=0ax+by+d=0 the gradient is −ab-\dfrac{a}{b}, not aa or bb — always rearrange to y=mx+cy=mx+c first, or use −a/b-a/b explicitly.
  • Mixing up the ratio direction in the section formula. AP:PB=m:nAP:PB=m:n puts mm with point BB's coordinates and nn with point AA's in the weighted average — reversing them gives the point that divides BABA instead.
  • Forgetting the vertical-line exception. A vertical line x=kx=k has no gradient (division by zero), and no amount of algebra on y=mx+cy=mx+c can represent it; it must be written in general or point-coordinate form.
  • Assuming equal gradient means equal line. Two lines can have m1=m2m_1=m_2 and still be distinct, parallel lines — equality of gradient is necessary for coincidence, not sufficient; also check the intercept or a point.
  • Sign errors in the perpendicularity condition. Perpendicular gradients are negative reciprocals (m1m2=−1m_1 m_2 = -1), not simply reciprocals (m1=1/m2m_1 = 1/m_2) — a common slip under exam pressure.
  • Treating the angle-between-lines formula as signed. Without the absolute value bars, the raw expression can return a negative tangent corresponding to the obtuse angle; the acute angle is always the one intended unless stated otherwise.

Summary

  • Distance: ∣AB∣=(x2−x1)2+(y2−y1)2|AB| = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}, from Pythagoras.
  • Midpoint: M=(x1+x22,y1+y22)M = \left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}\right); section formula for ratio m:nm:n: P=(nx1+mx2m+n,ny1+my2m+n)P = \left(\frac{nx_1+mx_2}{m+n}, \frac{ny_1+my_2}{m+n}\right).
  • Gradient: m=y2−y1x2−x1=tan⁡θm = \dfrac{y_2-y_1}{x_2-x_1} = \tan\theta, undefined for vertical lines.
  • Line forms: point-gradient y−y1=m(x−x1)y-y_1=m(x-x_1), slope-intercept y=mx+cy=mx+c, general ax+by+d=0ax+by+d=0 (gradient −a/b-a/b).
  • Parallel: m1=m2m_1=m_2. Perpendicular: m1m2=−1m_1 m_2 = -1.
  • Intersection of two lines: solve the two equations simultaneously.
  • Angle between two lines: tan⁡α=∣m1−m21+m1m2∣\tan\alpha = \left|\dfrac{m_1-m_2}{1+m_1m_2}\right|. </content>