# Get the equation of a circle when given 3 points

Get the equation of a circle through the points $(1,1), (2,4), (5,3)$.

I can solve this by simply drawing it, but is there a way of solving it (easily) without having to draw?

1. Consider the general equation for a circle as $(x-x_c)^2+(y-y_c)^2 - r^2 = 0$
2. Plug in the three points to create three quadratic equations $$(1-x_c)^2+(1-y_c)^2 - r^2 = 0$$ $$(2-x_c)^2+(4-y_c)^2 - r^2 = 0$$ $$(5-x_c)^2+(3-y_c)^2 - r^2 = 0$$
3. Subtract the first from the second, and the first from the third to create two linear equations $$-2 x_c -6 (y_c-3)=0$$ $$(y_c+7)-6 x_c = 0$$
4. Solve for the center as $$(x_c,y_c) = (3,2)$$
5. Plug the values for the center in any of the three quadratic equations above (I choose the first) and solve for $r$ $$(1-3)^2+(1-2)^2-r^2 = 0$$ $$5-r^2 = 0$$ $$r = \sqrt 5$$
6. Verify result with GeoGebra (optional)

• Anytime you turn a non-linear problem into a linear problem it is a win. – ja72 Apr 28 '14 at 20:54

Based on what I've learnt from this page by Stephen R. Schmitt (thanks to @Dan_Uznanski for pointing the concept out), there's a faster way to do it using matrices:

$$\text{let }〈x_1, y_1〉, 〈x_2, y_2〉, 〈x_3, y_3〉\text{ be your 3 points, and let }〈x_0, y_0〉\text{ represent the center of the circle.}\\\ \\ \text{let }A = \left[\begin{array}{cccc} x^2+y^2 & x & y & 1\\ x_1^2+y_1^2 & x_1 & y_1 & 1\\ x_2^2+y_2^2 & x_2 & y_2 & 1\\ x_3^2+y_3^2 & x_3 & y_3 & 1\\ \end{array}\right] = \left[\begin{array}{cccc} x^2+y^2 & x & y & 1\\ 1^2+1^2 & 1 & 1 & 1\\ 2^2+4^2 & 2 & 4 & 1\\ 5^2+3^2 & 5 & 3 & 1\\ \end{array}\right] = \left[\begin{array}{cccc} x^2+y^2 & x & y & 1\\ 2 & 1 & 1 & 1\\ 20 & 2 & 4 & 1\\ 34 & 5 & 3 & 1\\ \end{array}\right]\\\ \\\ \\\ \text{Note: }M_{11} = 0 ⟹ 〈x_0, y_0〉\text{ is undefined}∧\text{the points lie on a line rather than a circle.}\\\ \\\ x_0 = \frac{1}{2} ⋅ \frac{M_{12}}{M_{11}} = \left|\begin{array}{cccc} 2 & 1 & 1\\ 20 & 4 & 1\\ 34 & 3 & 1\\ \end{array}\right| \Bigg{/} \left|\begin{array}{cccc} 1 & 1 & 1\\ 2 & 4 & 1\\ 5 & 3 & 1\\ \end{array}\right| = \frac{1}{2} ⋅ \frac{-60}{-10} = 3$$

$$y_0 = -\frac{1}{2} ⋅ \frac{M_{13}}{M_{11}} = \left|\begin{array}{cccc} 2 & 1 & 1\\ 20 & 2 & 1\\ 34 & 5 & 1\\ \end{array}\right| \Bigg{/} \left|\begin{array}{cccc} 1 & 1 & 1\\ 2 & 4 & 1\\ 5 & 3 & 1\\ \end{array}\right| = -\frac{1}{2} ⋅ \frac{40}{-10} = 2$$

The radius, $r$, can then be calculated with Pythogoras' theorem, or using matrices again:

$$r^2 = x_0^2 + y_0^2 + \frac{M_{14}}{M_{11}}$$

• $M_{12}(A)$ is a minor of A — the determinant of $A$ without row $1$ or column $2$.
• Lines on either side of a matrix indicate the determinant (e.g. $|A|$) (sometimes written $\det{(A)}$)

If you have the time, it's really worth learning about matrices — they make a lot of things much faster, and are just generally awesome! KhanAcademy has a pretty easy introduction to matrices and linear algebra.

• I cross-confirmed that the above works. However, 1 + 1 = 2. \begin{bmatrix} x^2+y^2 & x & y & 1 \\ \mathbf 2 & 1 & 1 & 1 \\ 20 & 2 & 4 & 1 \\ 34 & 5 & 3 & 1 \\ \end{bmatrix} So $x_0$ = 3, $y_0$ = 2, and $r^2$ = 5. – Bob Veats Aug 9 '16 at 17:41
• Since the link in the post seems to be dead, here is a link to a version in the Wayback Machine. – Martin Sleziak Dec 10 '18 at 18:55

I'm surprised this one hasn't been mentioned; you can find the equation by using the determinant of a matrix:

$$\left|\begin{array}{cccc} x^2+y^2&x&y&1\\ 1^2+1^2&1&1&1\\ 2^2+4^2&2&4&1\\ 5^2+3^2&5&3&1\\ \end{array}\right|=0$$ This gives the equation of the circle through those three points. This sort of thing can be used in a lot of situations: matrix-determinant solutions are available for any shape I can think of where you're given points that land on the shape.

Implementing this on a computer involves having a thing that calculates determinants; to do it numerically you'll need to apply the cofactors method to avoid multiplying the variables in.

• One of my favorite tricks - extends to more general conics as well! – Mark McClure Apr 7 '15 at 22:03
• @Dan Uznasnski Can this method be extended to a circle defined by three points $(x,y,z)$ in space? – nonremovable Apr 6 '17 at 13:19
• I just tried it and don't like it. I'd suggest using 3d plane operations: you can find the center by intersecting the perpendicular bisector planes of $a, b$ and $a, c$: $(a-b)\cdot v = (a-b)\cdot(a+b)/2$ and the common plane that contains $a, b, c$. This gives you the center, and then distance to one of the points gives you a radius. The circle is then the intersection of the sphere and the common plane. – Dan Uznanski Apr 6 '17 at 21:37

Big hint:

Let $A\equiv (1,1)$,$B\equiv (2,4)$ and $C\equiv (5,3)$.

We know that the perpendicular bisectors of the three sides of a triangle are concurrent.Join $A$ and $B$ and also $B$ and $C$.

The perpendicular bisector of $AB$ must pass through the point $(\frac{1+2}{2},\frac{1+4}{2})$

Now find the equations of the straight lines AB and BC and after that the equation of the perpendicular bisectors of $AB$ and $BC$.Solve for the equations of the perpendicular bisectors of $AB$ and $BC$ to get the centre of your circle.

• Ok, this is my answer: Line segment AB has the formula $AB = 0,5x+0,5$ , so its bisector has $y=-2x+8$ and Line segment AC has formula $AC=3x-2$, so its bisector has $y=-\dfrac{1}{3}x+3$. Look for the intersection between the lines: $(3,2)$. From there it's easy to find that $r=\sqrt{5}$, so $(x-3)^2+(y-2)^2 = 5$ – JohnPhteven Oct 14 '12 at 15:26
• You seem to be on the right track.Write up your answer and post it as an answer to get feedback! – Richard Nash Oct 14 '12 at 15:28
• I think what you left out in your explanation is that the perpendicular bisector of a line between any two points on a circle will pass through the center of that circle. – Jemenake Jun 9 '16 at 14:30

You can also find first $R$ from the sin Law:

$$R= \frac{BC}{2 \sin (A)}= \frac{BC \cdot AB \cdot AC }{2 \| AB \times AC \|} \tag{*}$$

Next, write the equations of circles of radius $R$ with centre $A$ and $B$ and solve.

Note The formula $(*)$ is the well known geometric formula for the area of a triangle:

$$\mbox{Area}= \frac{abc}{4R} \,.$$

Consider the general (implicit) equation that defines a circle, with parameters $\alpha$, $\beta$, $\gamma$. Substitute the coordinate of the given points and get three linear equations in the three variables $\alpha$, $\beta$, $\gamma$. Solve the system.

“Plücker’s mu” provides another way to do this. Choose two of the points, $\mathbf p_1$ and $\mathbf p_2$, and let the equations of two circles that pass through those points be $f(x,y)=0$ and $g(x,y)=0$. Every linear combination of these two equations is also that of a circle (perhaps degenerate) that passes through these points. Then, an equation of the circle that also passes through the point $\mathbf p_0=(x_0,y_0)$ is $f(x_0,y_0)g(x,y)-g(x_0,y_0)f(x,y)=0$. This method applies generally to point sets that are given as null sets of functions.

Sometimes the coordinates are such that one can build the two required functions by inspection, but one can always use the “degenerate circle”—the line between two of the points—in this construction. For example, taking $\mathbf p_1=(1,1)$ and $\mathbf p_2=(5,3)$, we can use the circle centered at their midpoint: $$(x-3)^2+(y-2)^2=5$$ and the double line through these points: $$(x-2y+1)^2=0.$$ The required equation is then $$[(2-3)^2+(4-2)^2-5](x-2y+1)^2-(3-2\cdot4+1)^2[(x-3)^2+(y-2)^2-5]=0,$$ which simplifies to $(x-3)^2+(y-2)^2=5$. (This could also have been computed in matrix form, but that would’ve required expanding the equation of the line. In this case it was easier to work directly with the equations.)

Given 3 points P1(x1,y1) ,P2(x2,y2), and P3(x3,y3), on circle circumference whose center is (h,k) .. circle equation for each pair of points can be expressed as:

$$(x_1-h)^2+(y_1-k)^2 = (x_2-h)^2+(y_2-k)^2 ,$$ and $$(x_1-h)^2+(y_1-k)^2 = (x_3-h)^2+(y_3-k)^2 ,$$

By rearranging those equations, they can easily be put in the form of "difference of squares" in the form: $$(A-B)^2 = (C-D)^2$$

we get : $$(x_1-h)^2 - (x_2-h)^2 = (y_2-k)^2 - (y_1-k)^2 ,$$ Where $$A = (x_1-h) , B= (x_2-h) , C = (y_2-k) , D = (y_1-k)$$ Solving $$(A-B)^2 = (A-B)(A+B)$$ we get: $$[ (x_1-h) - (x_2-h) ] [(x_1-h) + (x_2-h) ] = [ (y_2-k)-(y_1-k) ] * [ (y_2-k) + (y_1-k) ]$$

simplifying:

$$(x_1-x_2)(x_1+x_2-2h) = (y_2-y_1)(y_2+y_1 -2k)$$

Introducing $$a_1=(x_1-x_2) , a_1' =(x_1+x_2) , b_1 = (y_2-y_1) , b_1' =(y_2+y_1)$$ And $$c_1 = \frac {(b_1b_1' - a_1a_1')} { 2a_1}$$

we get for each pair of points : $$h = \frac {b_1}{a_1} k - c_1$$ and another reduced equation for the other pair of points would give: $$h = \frac {b_2} {a_2} k - c_2$$

Solving above equations , we get : $$k = \frac {a_1a_2(c_1-c_2)} { (b_1a_2- b_2a_1)}$$

I know this question is outdated, but I like to show this easy solution.

First subtract the coordinates of a point from the others'. Now we are looking for the equation of a circle through the origin and two other points, which is of the form

$$(x-x_c)^2+(y-y_c)^2-r^2=x^2-2xx_c+y^2-2yy_c=0,$$ as there is no independent term.

This results in the $2\times2$ linear system of equations

$$\begin{cases}2x_cx_1+2y_cy_1=x_1^2+y_2^2,\\2x_cx_2+2y_cy_2=x_2^2+y_2^2.\end{cases}$$ giving the coordinates of the center and the radius $\sqrt{x_c^2+y_c^2}$. Don't forget to translate back by adding the first point.