Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 37 · Getting Started

The Coordinate Plane, Distance and Lines

Review the distance and midpoint formulas, circles, and the forms of a straight line, including parallel and perpendicular lines, with Python tools.

The coordinate plane lets you turn geometry into algebra. A point becomes a pair of numbers (x, y), a shape becomes an equation, and a question about distance becomes a formula. This lesson reviews the essential tools: distance, midpoint, circles and straight lines. They come back in function analysis, vectors, conics and calculus.

Distance and midpoint

For two points P₁(x₁, y₁) and P₂(x₂, y₂), draw a right triangle with horizontal leg x₂ - x₁ and vertical leg y₂ - y₁. The Pythagorean theorem gives the distance formula:

d = √((x₂ - x₁)² + (y₂ - y₁)²)

The midpoint is the average of the coordinates:

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

Example: for (1, 2) and (7, 10), the distance is √(36 + 64) = 10 and the midpoint is (4, 6).

Python Distance and midpoint calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Circles

A circle is all points at a fixed distance r (the radius) from a center (h, k). Setting the distance formula equal to r and squaring gives:

(x - h)² + (y - k)² = r²

To find the center and radius from an expanded equation, complete the square. For x² + y² - 6x + 4y - 12 = 0:

  • Group: (x² - 6x) + (y² + 4y) = 12
  • Complete squares: (x - 3)² + (y + 2)² = 12 + 9 + 4 = 25
  • Center (3, -2), radius 5.

A circle is not a function of x, since most x values give two y values (a vertical line cuts it twice). The next chapter explains that test.

Slope and the forms of a line

The slope of the line through (x₁, y₁) and (x₂, y₂) is

m = (y₂ - y₁) / (x₂ - x₁) (for x₁ ≠ x₂)

It measures rise per unit run. Positive slope rises to the right, negative falls, zero is horizontal, and a vertical line has undefined slope.

Form Equation Use when
Slope-intercept y = mx + b you know slope and y-intercept
Point-slope y - y₁ = m(x - x₁) you know a point and the slope
Standard Ax + By = C you need a tidy integer form
Vertical x = a slope is undefined

Example: the line through (1, 2) and (4, 11) has slope 9/3 = 3. Point-slope gives y - 2 = 3(x - 1), so y = 3x - 1.

Parallel and perpendicular lines

  • Parallel lines have equal slopes: m₁ = m₂.
  • Perpendicular lines have slopes that are negative reciprocals: m₁ · m₂ = -1.

So a line perpendicular to y = 3x - 1 has slope -1/3. Through the point (6, 0) it is y = -(1/3)(x - 6).

flowchart LR
A["Know two points"] --> B["Find slope m"]
B --> C["Use point-slope form"]
C --> D["Rearrange to y = mx + b"]

A reliable recipe for the equation of a line through two points.

Python Line through two points, and a perpendicular

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Using Fraction instead of floats keeps slopes exact, so -1/3 is not turned into -0.3333333.

Plotting lines and a circle together

A quick picture catches mistakes. This plot draws the circle from earlier and a line through its center.

Python Circle and lines on the plane

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the distance between (0, 0) and (5, 12)?

    √(25 + 144) = √169 = 13.
  2. 2. What are the center and radius of (x - 3)² + (y + 2)² = 25?

    The form is (x - h)² + (y - k)² = r², so h = 3, k = -2 and r = 5.
  3. 3. A line has slope 4. What is the slope of a line perpendicular to it?

    Perpendicular slopes multiply to -1, so the perpendicular slope is the negative reciprocal, -1/4.
  4. 4. Which line is vertical?

    A vertical line has the equation x = constant, and its slope is undefined.

Summary

  • Distance: √((x₂ - x₁)² + (y₂ - y₁)²); midpoint: average the coordinates.
  • A circle is (x - h)² + (y - k)² = r²; complete the square to find h, k, r.
  • Slope is rise over run; use point-slope or slope-intercept form.
  • Parallel lines share a slope; perpendicular slopes are negative reciprocals.

Next: Functions, Domain and Range