Skip to content
Tutorials Center
My learning

Topics

Lesson 32 of 37 · Coordinate Geometry and Proof

Equations of Lines and Circles

Write line equations in slope-intercept, point-slope and standard form, write the equation of a circle, and find where a line meets a circle, with plots and code.

A shape on the coordinate plane is the set of points (x, y) that make some equation true. In this lesson you learn the equations of the two most important curves of school geometry: the straight line and the circle. You also learn how to find where they meet.

Equations of lines

There are three common forms. Each is useful in a different situation.

Slope-intercept form: y = mx + b. Here m is the slope and b is the y-intercept (where the line crosses the y-axis). The line y = 2x - 3 has slope 2 and crosses the y-axis at (0, -3).

Point-slope form: y - y1 = m (x - x1). Use it when you know one point (x1, y1) on the line and the slope. Example: slope -1/2 through (4, 5) gives y - 5 = -½ (x - 4). Expanding: y = -½x + 7.

Standard form: Ax + By = C. It handles vertical lines (x = 3) and is common for intercepts. Rewriting y = -½x + 7 gives x + 2y = 14.

A line through two points

From P(1, 2) and Q(5, 10): the slope is (10 - 2)/(5 - 1) = 2. Use point-slope with P: y - 2 = 2(x - 1), so y = 2x. Check Q: 2 × 5 = 10 ✓.

Parallel and perpendicular lines through a point

To find the line through (3, 1) perpendicular to y = 2x + 7: the slope of the new line is -1/2, so y - 1 = -½(x - 3), giving y = -½x + 5/2.

Equation of a circle

A circle with center (h, k) and radius r consists of the points whose distance to the center equals r. Squaring the distance formula:

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

Example: center (2, -1), radius 4: (x - 2)² + (y + 1)² = 16. Note the sign change: y + 1 means k = -1. A circle centered at the origin simplifies to x² + y² = r².

A point (x, y) lies on the circle if substitution gives exactly r², inside if it gives less and outside if it gives more. This echoes the first lesson of the chapter.

Finding the center and radius

If an equation is expanded, such as x² + y² - 6x + 4y - 12 = 0, complete the square:

  1. Group: (x² - 6x) + (y² + 4y) = 12.
  2. Add 9 and 4 to both sides: (x - 3)² + (y + 2)² = 25.
  3. Read off: center (3, -2), radius 5.

Where a line meets a circle

Substitute the line into the circle's equation and solve the resulting quadratic. The discriminant D = b² - 4ac of that quadratic tells you how many intersection points there are:

Discriminant Meaning
D > 0 secant: two points
D = 0 tangent: one point
D < 0 the line misses the circle

Example: circle x² + y² = 25 and line y = x + 1. Substitute: x² + (x + 1)² = 25, so 2x² + 2x - 24 = 0, or x² + x - 12 = 0. Factor: (x + 4)(x - 3) = 0, so x = -4 or x = 3. The points are (-4, -3) and (3, 4). Check the second: 9 + 16 = 25 ✓.

A line is tangent to a circle exactly when its distance from the center equals the radius. This links the equation approach to the tangent-radius right angle you saw earlier.

Plot them

This program plots the line y = x + 1 and the circle x² + y² = 25 and marks the two intersection points you found by hand.

Python A line cutting a circle

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.

A solver for line-circle problems

The next program finds the intersection points with the quadratic formula, and uses the discriminant to describe the situation. It handles any line y = mx + b and any circle.

Python Line and circle intersection solver

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.

The second line, y = 5, is horizontal at distance 5 from the center, so it just touches the circle at (0, 5).

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What is the equation of the line with slope 3 through the point (2, 4)?

    y - 4 = 3(x - 2) gives y = 3x - 6 + 4 = 3x - 2.
  2. 2. Which equation describes a circle with center (-3, 4) and radius 6?

    The form is (x - h)² + (y - k)² = r² with h = -3 and k = 4, so x + 3 and y - 4, and r² = 36.
  3. 3. A circle has equation x² + y² = 49. Where is the point (5, 5)?

    25 + 25 = 50 is greater than 49, so the point is outside.
  4. 4. Substituting a line into a circle gives a quadratic with discriminant 0. What does that mean?

    One repeated solution means one point of contact: a tangent.

Summary

  • Line forms: y = mx + b, y - y1 = m(x - x1), Ax + By = C.
  • Circle: (x - h)² + (y - k)² = r²; complete the square to read the center and radius from an expanded equation.
  • Substitute a line into a circle to get a quadratic; its discriminant counts the intersections (2, 1 or 0).

Next: Coordinate Proofs