# What is the easier way to find the circle given three points?

Given three points $$(x_1,y_1)$$, $$(x_2,y_2)$$, and $$(x_3,y_3)$$, if $$\frac{y_2-y_1}{x_2-x_1} \neq \frac{y_3-y_2}{x_3-x_2} \neq \frac{y_1-y_3}{x_1-x_3},$$ then there will be a circle passing through them. The general form of the circle is $$x^2 + y^2 + dx + ey + f = 0.$$ By substituting $$x = x_i$$ and $$y = y_i$$, there will be a system of equation in three variables, that is:

\begin{align*} \begin{pmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \\ \end{pmatrix} \begin{pmatrix} d \\ e \\ f \end{pmatrix} &= \begin{pmatrix} -\left(x_1^2+y_1^2\right) \\ -\left(x_2^2+y_2^2\right) \\ -\left(x_3^2+y_3^2\right) \end{pmatrix}. \end{align*}

Solving this system gives the solution \begin{align*} d &= \frac{(x_3^2 + y_3^2 -x_1^2+y_1^2)}{x_1 - x_3} - e\left(\frac{y_1 - y_3}{x_1 - x_3}\right) \\ e &= \frac{(x_3^2 + y_3^2 -x_2^2+y_2^2)(x_1-x_3) - (x_3^2 + y_3^2 -x_1^2+y_1^2)(x_2-x_3)}{(y_2-y_3)(x_1-x_3) - (y_1-y_3)(x_2-x_3)} \\ f &= \frac{-(x_3^2 + y_3^2)(x_1-x_3) - (y_1-y_3)x_3}{x_1 - x_3} - e\left(\frac{y_3(x_1 - x_3) - x_3(y_1 - y_3)}{x_1 - x_3}\right) \end{align*}

As there are a lot of things going around, the solution is prone to errors. Maybe this solution also has an error.

Is there a better way to solve for the equation of the circle?

• You can use a $4\times 4$ determinant, as shown in this answer (and probably many more). Expanding the determinant is tedious, but entirely mechanical, and the result is the equation itself; there are no separate "solve" steps. This is the method I use to generate circle equations (and generally, conics), but it really helps to have a tool like Mathematica to do the symbol manipulation.
– Blue
Nov 25 at 18:10
• For the Cartesian coordinates of the circumcenter, see en.wikipedia.org/wiki/…
– lhf
Nov 25 at 18:24
• Another advantage of the determinant method is that it handles degeneracies seamlessly: if the given points are collinear (so that their circle has infinite radius), you'll find that the coefficients of $x^2$ and $y^2$ naturally calculate-out to zero, with no need to consider a separate case. ... This is perhaps more of an advantage with conics (and higher-degree curves): the general equation has six coefficients, but a conic is determined by five points; using a "solving" method requires assuming that one of the coefficients is non-zero, but there's no way to know which one to choose.
– Blue
Nov 25 at 18:25
• See also Finding center and radius of circumcircle for the formulation in complex numbers, which can then be easily translated to cartesian.
– dxiv
Nov 26 at 7:30
• In what context do you solve this? A test on paper, or a computer implementation? You got a nicely structured linear system, so whatever way you got a solution, you can test it against that system. In a computer one would just pass this system to a reliable linear solver procedure. Nov 26 at 8:33

Move the circle so that it passes through the origin (subtract a point from all three). The equation loses a coefficient,

$$x^2+y^2+dx+ey=0$$

which is easier to solve. Then reverse-translate.

$$-\frac d2=\dfrac{\begin{vmatrix}x_1^2+y_1^2&y_1\\x_2^2+y_2^2&y_2\end{vmatrix}}{2\begin{vmatrix}x_1&y_1\\x_2&y_2\end{vmatrix}}$$

$$-\frac e2= \dfrac{\begin{vmatrix}x_1&x_1^2+y_1^2\\x_2&x_2^2+y_2^2\end{vmatrix}}{2\begin{vmatrix}x_1&y_1\\x_2&y_2\end{vmatrix}}$$

are the coordinates of the center in the moved position.

This is more a sketch than a full solution but you can try to emulate the ruler and compass construction. This allows to you to interpret and thus check some of the intermediate results.

So start with two of the three points, find the mid point and then set up the equation for the line that goes through the midpoint and is perpendicular to the line through the two points. Repeat with two more points. The center of the circle is the intersection of the two lines. The radius is the distance between the center and any of the three points.

I'm not sure whether this actually requires less computation than what you did but as the intermediate steps all have a meaning it is easier to check whether you made computational errors.

Edit: Note that the idea by circle lover and this idea can be combined. Translating one point to the origin makes these computations much easier as well.

I prefer a different approach.

You know that the center of the circle is the intersection between any two of the three perpendicular bisectors.

Therefore,

$$(x - x_1)^2 + (y - y_1)^2 = (x - x_2)^2 + (y - y_2)^2 \tag1$$

and

$$(x - x_1)^2 + (y - y_1)^2 = (x - x_3)^2 + (y - y_3)^2. \tag2$$

Let $$f_1(x) = (x - x_1)^2 - (x - x_2)^2. ~~: ~~$$ 1st degree polynomial

Let $$f_2(x) = (x - x_1)^2 - (x - x_3)^2. ~~: ~~$$ 1st degree polynomial

Let $$g_1(y) = (y - y_2)^2 - (y - y_1)^2. ~~: ~~$$ 1st degree polynomial

Let $$g_2(y) = (y - y_3)^2 - (y - y_1)^2. ~~: ~~$$ 1st degree polynomial

You can express $$g_2(y)$$ as $$Ag_1(y) + B$$, where $$A,B$$ are fixed real numbers.

This implies that

$$f_2(x) = g_2(y) = Ag_1(y) + B = Af_1(x) + B. \tag3$$

Equation (3) above gives you an equation solely in $$x$$, that you can solve to determine the $$(x = x_0)$$ coordinate of the center of the circle. Once this is determined, you can compute $$y_0$$ via $$g_1(y_0) = f_1(x_0).$$

I would attack this question step-by-step by making any two chords from the three points A,B and C , call them AB and BC.

Now find the mid point of AB (D) and draw a line perpendicular to AB from D, name it l1 . Do the same for the mid-point of BC (E), name this l2. The place where l1 and l2 meet will be the center. I leave it to you to prove that (hint: the distance of A and B will be equal to the center, hence the center should lie on the line l1 to maintain the isosceles property of ABO (if O is center) )

Solving the two equation of lines l1 and l2 you can find the center O. Find the distance r by finding the distance between O and any of A,B or C. Now you have the radius r. Use the standard equation of circle and plug in the radius(r) and center(O).