← Mathematics

Lesson 16 · 50 min

Coordinate geometry of straight lines

Use coordinates to measure segments and build equations of lines.

Talk to Live Tutor about this lesson

Coordinates turn position into numbers

In the Cartesian plane, a point (x, y) has horizontal coordinate x and vertical coordinate y. Positive x lies to the right of the origin; positive y lies above it. Order matters: (2, 5) and (5, 2) are usually different points. The axes divide the plane into quadrants, and a point on an axis has one coordinate zero. Choose a scale that fits the data and label both axes so that a plotted point has an interpretable position.

For A(x₁, y₁) and B(x₂, y₂), the horizontal is x₂ − x₁ and vertical is y₂ − y₁. These differences can be negative because they record direction. Distance is nonnegative. Pythagoras' theorem gives. Between (−1, 2) and (3, 5), the differences are 4 and 3, so distance is 5. Squaring the differences also shows why reversing the order of the points leaves distance unchanged.

Key equation
AB=√[(x₂−x₁)²+(y₂−y₁)²]

Midpoints and dividing a segment

The midpoint averages the coordinates. For A(−2, 3) and B(6, 7), the midpoint is (2, 5). Average coordinates of the same type; do not average x with y. A midpoint must lie halfway along the segment, so inspect whether each coordinate is between its endpoint values. If one endpoint and the midpoint are known, reverse the calculation. With A(1, 4) and M(3, 7), the other endpoint is (5, 10).

Key equation
M=((x₁+x₂)/2,(y₁+y₂)/2)

A point dividing AB internally in ratio m:n, meaning AP:PB = m:n, has coordinates ((nx₁ + mx₂)/(m + n), (ny₁ + my₂)/(m + n)). The weights may initially look reversed because a point closer to A gives A's coordinates the larger weight. For A(0, 0), B(9, 6) and AP:PB = 1:2, P lies one third of the way from A to B, so. Understanding the position is safer than memorising weights without interpreting them.

Key equation
P=(3,2)

measures rise per horizontal run

For a nonvertical line through two distinct points, . The same ordering must be used in numerator and denominator. Through (1, 2) and (5, 10), m = 8/4 = 2. A positive rises to the right, a negative one falls, and a horizontal line has zero . A vertical line has undefined because its horizontal is zero. “Undefined” is not the same as “zero”.

Key equation
m=y₂−y₁x₂−x₁

Parallel nonvertical lines have equal gradients. Perpendicular nonvertical lines satisfy m₁m₂ = −1, so a line perpendicular to 2 has −1/2. The horizontal and vertical pair is perpendicular too, but the product rule cannot be applied directly because the vertical is undefined. Equal gradients alone do not establish that two lines are distinct: they may be the same line if their intercepts also agree. Check the full equations when the question asks for parallel distinct lines.

Write an equation of a line

The point-slope form is. Through (2, 5) with 3, it gives, so. The slope-intercept form makes m and y-intercept c visible. The intercept is the value of y when x = 0; it is a point (0, c), not a horizontal distance. To find an x-intercept, set y = 0 and solve for x.

Key equation
y−y₁=m(x−x₁)
y−5=3(x−2)
y=3x−1
y=mx+c

If two points are given, calculate the , substitute one point into point-slope form, then verify the other point. The line through (1, 4) and (3, 8) has 2, so, or y = 2x + 2. Both supplied points satisfy the equation. A vertical line through (3, 8) is simply x = 3, while a horizontal line through it is y = 8. Neither requires forcing an unsuitable form.

Key equation
y−4=2(x−1)
y=mx+c

General form and intersections

A straight line can be written Ax + By + C = 0, with A and B not both zero. If B ≠ 0, rearrange to. For 2x + 3y − 12 = 0, is −2/3 and y-intercept is 4. Its x-intercept is 6. Multiplying every by the same nonzero number gives the same line. Therefore 4x + 6y − 24 = 0 does not describe a second distinct line.

Key equation
y=−(A/B)x−CB

The intersection of two lines is their simultaneous solution. For and, obtaining x = 2 and y = 5. Parallel distinct lines have no common point; coincident lines have infinitely many. Algebraic solving is usually more precise than reading a sketch, but a graph can confirm the approximate location. Label an intersection as a coordinate pair, because giving only x omits half the positional answer.

Key equation
y=2x+1
y=−x+7,set2x+1=−x+7

Use geometry to check algebra

A perpendicular bisector passes through a segment's midpoint and is perpendicular to the segment. For A(0, 0) and B(4, 2), midpoint is (2, 1), segment is 1/2 and perpendicular is −2. Its equation is, or y = −2x + 5. Every point on this line is equidistant from A and B. This connects coordinate methods with a locus and provides an independent reason for the construction.

Key equation
y−1=−2(x−2)

Self-check: find the distance and midpoint between (2, −1) and (8, 7). The answers are 10 and (5, 3). Find the line through (0, 4) perpendicular to: it is. Check signs carefully when subtracting negative coordinates, and retain exact fractions until a final approximation is requested. A labelled sketch is useful, but coordinate values and algebraic verification determine the exact result.

Key equation
y=2x+1
y=−x2+4

Connect a distance condition with a circle

Points (x, y) at distance r from a centre (a, b) satisfy by the distance formula. A circle centred at (2, −1) with radius 3 therefore has equation (x − 2)² + (y + 1)² = 9. The sign inside each bracket is obtained by subtracting the centre coordinate, so a negative centre coordinate creates a plus sign. The centre is not a point on its own circumference when r > 0.

Key equation
(x−a)²+(y−b)²=r²

Coordinates also provide an area check. For a triangle with a horizontal base from (1, 2) to (7, 2) and third vertex (4, 6), the base is 6 units and perpendicular height is 4, so area is 12 square units. Do not use the sloping distance from a base endpoint as the height. Translating the whole triangle changes its coordinates but preserves its lengths and area, which can simplify a calculation without changing the geometry.

Recognise a two-point equation

A denominator-free two-point form through distinct points (x₁, y₁) and (x₂, y₂) is. It comes from equal gradients when the line is nonvertical, and its cross-multiplied form also handles a vertical line. For (1, 4) and (3, 8), it gives, simplifying to y = 2x + 2.

Key equation
(y−y₁)(x₂−x₁)=(y₂−y₁)(x−x₁)
2(y−4)=4(x−1)

Topic revision bank

Key rules & principles

  • Distance uses squared coordinate differences.
  • A midpoint averages matching coordinates.
  • is vertical change divided by horizontal change.
  • For nonvertical perpendicular lines, product is −1.

Worked examples

Find the equation through (2, 5) with gradient 3.
  1. Use y − y₁ = m(x − x₁).
  2. Substitute: y − 5 = 3(x − 2).
  3. Expand and rearrange: y = 3x − 1.
  4. Check the supplied point: 5 = 6 − 1.

Answer: y = 3x − 1.

Find the perpendicular bisector of the segment from (0, 0) to (4, 2).
  1. Midpoint is (2, 1).
  2. Segment is 2/4 = 1/2.
  3. Perpendicular is −2.
  4. Use y − 1 = −2(x − 2).

Answer: y = −2x + 5.

Related videos and resources

Videos load only when you choose, to save data.

Distance between Two Points Video

Corbettmaths

Distance between two points; gradients and equations of lines remain in the reading.

Sign in to take the topic quiz and track your progress.

Sign in
Next lesson

Trigonometry, bearings and non-right triangles →