# Line intersecting circle.xls

### Description

Purpose of calculation

Find intersection between a line and a circle with centre at origin.

Calculation Reference

Geometry for Enjoyment and Challenge, Rhoad

Calculation Validation

Check graphically in chart.

XLC addin used to verify cell formulas.

**Calculation Reference**

Geometry for Enjoyment and Challenge, Rhoad

Geometry

Coordinate geometry

To find the intersection between a line and a circle with center at the origin, we can use the general equation of a circle:

x^2 + y^2 = r^2

where (0,0) is the center of the circle, and r is the radius.

Let the equation of the line be y = mx + b, where m is the slope and b is the y-intercept.

Substituting y = mx + b into the equation of the circle, we get:

x^2 + (mx + b)^2 = r^2

Expanding the squares, we get:

x^2 + m^2x^2 + 2bmx + b^2 = r^2

Rearranging, we get:

(m^2 + 1) x^2 + 2bm x + (b^2 - r^2) = 0

This is a quadratic equation in x. Solving for x using the quadratic formula, we get:

x = [-bm ± sqrt((bm)^2 - (m^2 + 1)(b^2 - r^2))] / (m^2 + 1)

Substituting this value of x into the equation of the line, we get the corresponding values of y:

y = mx + b

So the points of intersection between the line and the circle are:

(x1, y1) = ([-bm + sqrt((bm)^2 - (m^2 + 1)(b^2 - r^2))] / (m^2 + 1), m([-bm + sqrt((bm)^2 - (m^2 + 1)(b^2 - r^2))] / (m^2 + 1)) + b)

(x2, y2) = ([-bm - sqrt((bm)^2 - (m^2 + 1)(b^2 - r^2))] / (m^2 + 1), m([-bm - sqrt((bm)^2 - (m^2 + 1)(b^2 - r^2))] / (m^2 + 1)) + b)

These are the two points of intersection between the line and the circle.

### Calculation Preview

Full download access to any calculation is available to users with a paid or awarded subscription (XLC Pro).

Subscriptions are free to contributors to the site, alternatively they can be purchased.

Click here for information on subscriptions.