Gradient, length and midpoint
IGCSE Mathematics · Coordinate geometry
The three formulae
For two points $A(x_{1},y_{1})$ and $B(x_{2},y_{2})$:
$$m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}},\qquad AB=\sqrt{(x_{2}-x_{1})^{2}+(y_{2}-y_{1})^{2}},\qquad M=\left(\frac{x_{1}+x_{2}}{2},\;\frac{y_{1}+y_{2}}{2}\right)$$Gradient is change in $y$ over change in $x$ — the $y$ values on top. Length comes straight from Pythagoras: the two differences are the legs of a right-angled triangle and $AB$ is its hypotenuse. Midpoint is the average of each coordinate separately.
Reading a gradient
- positive gradient: the line rises left to right;
- negative gradient: it falls;
- gradient $0$: horizontal, equation $y=c$;
- gradient undefined: vertical, equation $x=k$ — the denominator $x_{2}-x_{1}$ is zero, and dividing by zero has no value at all. "Gradient zero" and "gradient undefined" are opposite cases.
Order does not matter — as long as it is consistent
Taking $A$ first or $B$ first changes the sign of both the numerator and the denominator, so the gradient is unchanged. Taking $A$ first on top and $B$ first underneath, however, flips the sign — and that is the single most common slip in this topic.
Worked example: gradient and length from two points
Given $A(-3,7)$ and $B(5,-1)$. Calculate the gradient of $AB$, the length $AB$ and the coordinates of the midpoint of $AB$.
Solution
Gradient. Take $B$ as the second point and keep that same order in both numerator and denominator:
$$m=\frac{-1-7}{5-(-3)}=\frac{-8}{8}=-1$$The negative sign makes sense: $y$ decreases from $7$ to $-1$ while $x$ increases.
Length.
$$AB=\sqrt{8^{2}+(-8)^{2}}=\sqrt{64+64}=\sqrt{128}=8\sqrt{2}\approx 11.3$$In the length formula, the signs of the two differences do not matter because they are squared — this is why the order of the two points never causes an error in the length part, only in the gradient part.
Midpoint.
$$M=\left(\frac{-3+5}{2},\;\frac{7+(-1)}{2}\right)=(1,\;3)$$Quick check: $M$ must lie between the two points in both coordinates — $1$ lies between $-3$ and $5$, $3$ lies between $-1$ and $7$ ✓.
Worked example: dividing a line segment in a ratio
$A(2,1)$ and $B(6,9)$. The point $P$ lies on $AB$ such that $AP:PB=1:3$. Find the coordinates of $P$.
Solution
Step 1 — understand what the ratio says. $AP:PB=1:3$ means the segment $AB$ is divided into $1+3=4$ equal parts, and $P$ is one quarter of the way from $A$.
Step 2 — start from $A$, add one quarter of each change.
$$\Delta x=6-2=4,\qquad \Delta y=9-1=8$$$$P=\left(2+\tfrac{1}{4}(4),\;1+\tfrac{1}{4}(8)\right)=(3,\;3)$$Step 3 — check. $AP=\sqrt{1^{2}+2^{2}}=\sqrt{5}$ and $PB=\sqrt{3^{2}+6^{2}}=\sqrt{45}=3\sqrt{5}$, exactly the ratio $1:3$ ✓.
A common place to go wrong: using $\dfrac{1}{3}$ instead of $\dfrac{1}{4}$, because the number $3$ in the ratio jumps out at the eye. Remember that the denominator is always the sum of the two parts, not the second part.