Find Equation of Circle

With two given points on a circle and a line on which the center of the circle can be found, we can derive the equation of the circle.

Enter two points A and B that exist on the circle. Then enter three values for the equation of a line in the form ax+by+c=0ax + by + c = 0

Point A

Point B

Equation of line passing through the center

x +x \ + y +y \ + =0=0

A(x1,y1) B(x2,y2)A(x_1, y_1) \ B(x_2, y_2)

l:ax+b+c=0 l: ax + b + c = 0

Graph:

Method:

To solve this problem where two points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2,y_2) on the circle are given a line and l:ax+by+c=0l: ax + by + c = 0 on which the center should lie, it starts with creating a variable for the center of the circle.

C(h,k)C(h,k)

We know that all points on the circle are equidistant from the center, so the distance d(A,C)d(A, C) and d(B,C)d(B, C) would be the same. Putting these two relations together looks like;

(x1h)2+(y1k)2=(x2h)2+(y2k)2\sqrt{(x_1-h)^2 + (y_1-k)^2} = \sqrt{(x_2-h)^2 + (y_2-k)^2}

This can be resolved into the following equation representing hh and kk as;

2h(x2x1)+2k(y2y1)=x22x12+y22y12[1]2h(x_2-x_1) + 2k(y_2-y_1) = {x_2}^2 - {x_1}^2 + {y_2}^2 - {y_1}^2 \quad \text{[1]}

Since C(h,k)C(h,k) lies on the line ax+by+c=0ax + by + c = 0, then the point must satisfy the equation to give us;

ah+bk=c[2]ah + bk = -c \quad \text{[2]}

You can solve equation (1) and (2) through any preference, Cramer's rule, substitution, or comparison, or any other. The resolved form for hh and kk will become;

h=(x22x12+y22y12)b+2c(y2y1)2b(x2x1)2a(y2y1)h = \dfrac{({x_2}^2 - {x_1}^2 + {y_2}^2 - {y_1}^2)b + 2c(y_2-y_1)}{2b(x_2-x_1) - 2a(y_2-y_1)}

k=(x22x12+y22y12)a+2c(x2x1)2a(y2y1)2b(x2x1)k = \dfrac{({x_2}^2 - {x_1}^2 + {y_2}^2 - {y_1}^2)a + 2c(x_2-x_1)}{2a(y_2-y_1) - 2b(x_2-x_1)}

Notice that both of the formulas have the same determinant (but with flipped signs). Now, the determinant can be zero to signify that there is a problem with the inputs. A denominator of zero means that either a solution is not possible or infinitely many solutions are possible.

What does determinant zero mean?

Let us see when does the determinant become zero by setting it to zero and playing around with it.

2a(y2y1)2b(x2x1)=02a(y_2-y_1) - 2b(x_2-x_1) = 0

a(y2y1)b(x2x1)=0 \Rightarrow a(y_2-y_1) - b(x_2-x_1) = 0

a(y2y1)=b(x2x1)\Rightarrow a(y_2-y_1) = b(x_2-x_1)

y2y1x2x1=ba\Rightarrow \dfrac{y_2-y_1}{x_2-x_1} = \dfrac{b}{a}

You should note that left and right parts of this equation represent two slopes. m1=y2y1x2x1m_1 = \dfrac{y_2-y_1}{x_2-x_1} is the slope between the two points AA and BB.

The slope of the line l:ax+by+cl: ax + by + c is m2=abm_2 = -\dfrac{a}{b} which is the negative of the reciprocal of the right side.

y2y1x2x1=ba\dfrac{y_2-y_1}{x_2-x_1} = \dfrac{b}{a}

m1=1m2\Rightarrow m_1 = -\dfrac{1}{m_2}

m1m2=1\Rightarrow m_1m_2 = -1

This final relation is only true if the two slopes m1m_1 and m2m_2 are perpendicular to each other. Which means that we can use the above relation for hh and kk to find their values as long as these slopes are not perpendicular.

What to do if determinant is zero?

Put in the following values in the above tool to visualize such a situation, put in A(1,1)A(1, 1), B(5,5)B(5,5) and the line as l:x+y6=0l: x + y - 6 = 0.

With these, the two slopes are perpendicular, but this configuration can have infinitely many circles that satisfy all conditions. The default center of the smallest circle can be;

h=x1+x22h = \dfrac{x_1+x_2}{2}

k=y1+y22k = \dfrac{y_1+y_2}{2}

But in this case, note how the line is perfectly inbetween the points AA and BB. In this situation, all points on the given line can draw a circle that perfectly sits upon the two points.

Now, play with the c value of the line to translate it left or right and note that the circle disappears. With these slopes, circles are only possible if the line is smack dab in the middle.

In those cases, a solution is just not possible.

How to Find Radius:

When you have calculated the hh and kk, then radius is simple calculated by either;

r=(hx1)2+(ky1)2r = \sqrt{(h-x_1)^2 + (k-y_1)^2}

Or

r=(hx2)2+(ky2)2r = \sqrt{(h-x_2)^2 + (k-y_2)^2}

How to Assemble the Equation:

Once you have calculated the hh, kk and rr, put them in the following relation;

(xh)2+(yk)2=r2(x-h)^2 + (y-k)^2 = r^2

And simplify to;

x2+y22hx2ky+(h2+k2r2)=0x^2 + y^2 -2hx -2ky + (h^2 + k^2 - r^2) = 0

← Back to Calculators