# Equation of a circle through 3 points in 3D space

Hello there

I am trying to figure out this but am having some difficulty. Your help would be much appreciated.

I have 3 points in 3D space: (x1,y1,z1), (x2,y2,z2) and (x3,y3,z3). My objective: I need to find out the radius of the circle that passes through these 3 points.

I know how to do this if the points were in 2D space (there are several Google links that explain it). But I don't know how to do it if the points are in 3D space. I don't need the equation of the circle, just the radius of the circle that passes through these three 3D points.

Thanks a lot for taking the time to respond.

Homework Helper
you can find the distances between these three points, and the angles between all the lines through pairs of points, thus you can construct a triangle - now you need the radius of the circle that circumscribes such a triangle, which is purel y a problem in the plane that you know how to do.

Dr. Proof
Be careful. Not all triangles can be circumscribed by a circle. While there is an infinite number of triangles in 3-D space that can be circumscribed by a circle, not all possible triangles can be circumscribed by a circle. It is possible to have a set of three points that cannot be circumscribed by a circle.

Staff Emeritus
Three non-colinear points define a plane. Three non-colinear points on a plane form the vertices of a triangle. All triangles have a circumcircle; this is one of Euclid's propositions. The only constraint is that the points not be colinear.

haiha
I still think there is only one circle that circumscribes the given triangle no mater in 2D or 3D. A triangle always defines a plane.

Dr. Proof
Three non-colinear points define a plane. Three non-colinear points on a plane form the vertices of a triangle. All triangles have a circumcircle; this is one of Euclid's propositions. The only constraint is that the points not be colinear.

You are absolutely correct D H. All triangles do indeed have a circumcircle. I was absolutely dead wrong to say that there are some triangles that do not have a circumcircle.

I am sorry if my statement generated any confusion for you, ady_mech.

I thinks it's ironic that I tried to help on this forum, and now I am the one doing the learning:rofl:

Werg22
Be careful. Not all triangles can be circumscribed by a circle. While there is an infinite number of triangles in 3-D space that can be circumscribed by a circle, not all possible triangles can be circumscribed by a circle. It is possible to have a set of three points that cannot be circumscribed by a circle.

? I don't think you are correct... Say we chose two points (on the xy plane) and define the line that goes through both and then the median. Any point on the median is equally distanced from the two points. The equation of the median can be put in the form

$$y = mx + b$$

Say A and B are the points in question. Point C is the other one. For a particular point on the median, the distance squared between that point and $$A = (a_{x}, a_{y})$$ is

$$(x - a_{x})^{2} + (mx + b - a_{y})^2$$

And the distance squared between that point and $$C = (c_{x}, c_{y})$$ is

$$(x - c_{x})^{2} + (mx + b - c_{y})^2$$

And hence in order to find the center of the circle we solve

$$(x - a_{x})^{2} + (mx + b - a_{y})^2 = (x - c_{x})^{2} + (mx + b - c_{y})^2$$

which simplifies to

$${a_{x}}^{2} -2{a_{x}}x + (a_{y} -b)^2 - mx(a_{y} - b) = {c_{x}}^{2} -2{c_{x}}x + (c_{y} -b)^2 - mx(c_{y} - b)$$

Which is a first degree equation and hence it is solvable regardless of the vertice of the triangle.

Last edited:
Dr. Proof
? I don't think you are correct... Say we chose two points (on the xy plane) and define the line that goes through both and then the median. Any point on the median is equally distanced from the two points. The equation of the median can be put in the form

Werg22: You should have read post #6 before you went through all the trouble.  Greek000
Solution to the problem

you can find the distances between these three points, and the angles between all the lines through pairs of points, thus you can construct a triangle - now you need the radius of the circle that circumscribes such a triangle, which is purel y a problem in the plane that you know how to do.

Well, you only need to find the distances between these three points in 3D space, which correspond to the lengths of the triangle sides. This is an easy task. If we name these distances a, b, c then the radius R of the circumscribed circle is:

$$R= \frac {abc}{\sqrt{2a^2b^2+2b^2c^2+2c^2a^2-a^4-b^4-c^4}}$$

When the points are colinear the quantity inside the square root becomes zero, and therefore the radius becomes infinite as it should.

Wiggers
Now the 3D Center Point

The above thread is helpful, but I'd like to add the question of now finding the coordinates of the circle center. The last replay by "Greek000" gives the solution for finding the Radius. Is there a simple solution for the coordinates?

thanks,
Rob

Last edited:
Finding coordinates of the center

Suppose we have 3 points p1,p2,p3. Make two vectors P1P2 and P2P3 .Using this two we can calculate normal to the plane formed by given 3 points. Say N is the normal.

Now direction of bisector of p1 and p2 is given by cross product of b1 = P1P2 x N. Similarly for p2 and p3 is b2 = P2P3 x N.

Now find equation of two bisector line using the midpoint of p1 and p2 and b1 vector. Similarly find another bisector . Solve them to get the center of circumcircle.

ice109
ha i just suggested a solution to another problem that works for this one. you have 3 points

solve the system of 3qns 3unknowns for a general cylinder for a,b,R:
(x-az)^2+(y-bz)^2=R^2

I would be glad if you could explain a little bit more on this problem. i.e. How can u get the coordinates of circumcenter using your method

ice109
I would be glad if you could explain a little bit more on this problem. i.e. How can u get the coordinates of circumcenter using your method

maze
Let the vectors from the origin to the 3 points you know be $\vec{p}_1,\vec{p}_2,\vec{p}_3$, and call the vector from the origin to the center point $\vec{c}$. Our goal is to find $\vec{c}$.

The vector from point 1 to the center, $\vec{p}_1-\vec{c}$, must be the same length as the vector from point 2 to the center, $\vec{p}_2-\vec{c}$, which must be the same length as the vector from point 3 to the center, $\vec{p}_3-\vec{c}$. In other words, we have the following 3 equations:
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)$$
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_3\right)\cdot\left(\vec{c}-\vec{p}_3\right)$$
$$\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)=\left(\vec{c}-\vec{p}_3\right)\cdot\left(\vec{c}-\vec{p}_3\right)$$

Focus on the first one. We can multiply this out and simplify (note the cancellation of $\vec{c}\cdot\vec{c}$):
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)$$
$$-2\vec{c}\cdot\vec{p}_1+\vec{p}_1\cdot\vec{p}_1=-2\vec{c}\cdot\vec{p}_2+\vec{p}_2\cdot\vec{p}_2$$
$$\vec{c}\cdot\left(\vec{p}_2-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2\right)/2$$

The same thing could be done for the other 2 starting equations, in which case we get the following 3 results:
$$\vec{c}\cdot\left(\vec{p}_2-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2\right)/2$$
$$\vec{c}\cdot\left(\vec{p}_3-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3\right)/2$$
$$\vec{c}\cdot\left(\vec{p}_3-\vec{p}_2\right)=\left(\vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3\right)/2$$

If we recast these 3 equations in matrix form, we get,
$$\left(\begin{matrix}\vec{p}_2-\vec{p}_1 \\ \vec{p}_3-\vec{p}_1 \\ \vec{p}_3-\vec{p}_2\end{matrix}\right)\cdot\vec{c} = \frac{1}{2}\left(\begin{matrix}\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2 \\ \vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3 \\ \vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3 \end{matrix}\right)$$

Then multiplying both sides by the matrix inverse, we get the center, $\vec{c}$.
$$\vec{c} = \frac{1}{2}\left(\begin{matrix}\vec{p}_2-\vec{p}_1 \\ \vec{p}_3-\vec{p}_1 \\ \vec{p}_3-\vec{p}_2\end{matrix}\right)^{-1}\left(\begin{matrix}\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2 \\ \vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3 \\ \vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3 \end{matrix}\right)$$

You can find the radius by taking the length of the vector from the center to one of the points on the circle,
$$R =\left|\vec{c}-\vec{p}_1\right|$$

richardmcc2
Let the vectors from the origin to the 3 points you know be $\vec{p}_1,\vec{p}_2,\vec{p}_3$, and call the vector from the origin to the center point $\vec{c}$. Our goal is to find $\vec{c}$.

The vector from point 1 to the center, $\vec{p}_1-\vec{c}$, must be the same length as the vector from point 2 to the center, $\vec{p}_2-\vec{c}$, which must be the same length as the vector from point 3 to the center, $\vec{p}_3-\vec{c}$. In other words, we have the following 3 equations:
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)$$
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_3\right)\cdot\left(\vec{c}-\vec{p}_3\right)$$
$$\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)=\left(\vec{c}-\vec{p}_3\right)\cdot\left(\vec{c}-\vec{p}_3\right)$$

Focus on the first one. We can multiply this out and simplify (note the cancellation of $\vec{c}\cdot\vec{c}$):
$$\left(\vec{c}-\vec{p}_1\right)\cdot\left(\vec{c}-\vec{p}_1\right)=\left(\vec{c}-\vec{p}_2\right)\cdot\left(\vec{c}-\vec{p}_2\right)$$
$$-2\vec{c}\cdot\vec{p}_1+\vec{p}_1\cdot\vec{p}_1=-2\vec{c}\cdot\vec{p}_2+\vec{p}_2\cdot\vec{p}_2$$
$$\vec{c}\cdot\left(\vec{p}_2-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2\right)/2$$

The same thing could be done for the other 2 starting equations, in which case we get the following 3 results:
$$\vec{c}\cdot\left(\vec{p}_2-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2\right)/2$$
$$\vec{c}\cdot\left(\vec{p}_3-\vec{p}_1\right)=\left(\vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3\right)/2$$
$$\vec{c}\cdot\left(\vec{p}_3-\vec{p}_2\right)=\left(\vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3\right)/2$$

If we recast these 3 equations in matrix form, we get,
$$\left(\begin{matrix}\vec{p}_2-\vec{p}_1 \\ \vec{p}_3-\vec{p}_1 \\ \vec{p}_3-\vec{p}_2\end{matrix}\right)\cdot\vec{c} = \frac{1}{2}\left(\begin{matrix}\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2 \\ \vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3 \\ \vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3 \end{matrix}\right)$$

Then multiplying both sides by the matrix inverse, we get the center, $\vec{c}$.
$$\vec{c} = \frac{1}{2}\left(\begin{matrix}\vec{p}_2-\vec{p}_1 \\ \vec{p}_3-\vec{p}_1 \\ \vec{p}_3-\vec{p}_2\end{matrix}\right)^{-1}\left(\begin{matrix}\vec{p}_1\cdot\vec{p}_1-\vec{p}_2\cdot\vec{p}_2 \\ \vec{p}_1\cdot\vec{p}_1-\vec{p}_3\cdot\vec{p}_3 \\ \vec{p}_2\cdot\vec{p}_2-\vec{p}_3\cdot\vec{p}_3 \end{matrix}\right)$$

You can find the radius by taking the length of the vector from the center to one of the points on the circle,
$$R =\left|\vec{c}-\vec{p}_1\right|$$

I've been working on this problem for the last couple of days and I tried this method, but it didn't work. The 3 equations are not all independent, only two of them are, so when I tried to take the inverse of the 3x3 matrix, I couldn't because the determinant was zero.

I solved the problem today with a different method. The center of the circle defined by 3 points can also be described as the orthocenter of the triangle formed by the three points. Mathworld had a relatively simple equation (http://mathworld.wolfram.com/BarycentricCoordinates.html) for the orthocenter in terms of barycentric coordinates, so I was able to find them, and then convert to rectangular coordinates.

maze
Interesting, thanks for the reply after so long. I suppose it would give a line of solutions through the center and perpendicular to the plane the points lie in.

I think you could salvage it taking the intersection with the plane the points lie on.

Marin
Hi!

In order to define a circle in R^3 we need a normal vector, the radius and the centre point.

Now, consider we had three non collinear points(A,B,C). I saw a very fast way to compute the radius (R), equally fast we can calculate the normal vector (n) (through the place by (ABC).

What's left is the centre of the circumscribed circle: we take two of the the vectors representing the sides of the triangle (e.g. AB and BC). We calculate the midpoints. Now we're looking for lines, orthogonal to AB respectively BC which intersect each other at a point of the plane (ABC) (note that the lines have to lie in the plane as well). The point should be considered as the centre of the circumscribed circle.

So we got all we need.

What I haven't learned about in my analytical geometry lessons at school last autumn is what the equation looks like?

The equation of a circle in R^2 reads: (x-x_0)^2 + (y - y_0)^2 = r^2 , where:
M(x_0 ; y_0) is the centre of the circle and r is it's radius.

Can someone type the general equation in R^3 (and maybe also the equation of a sphere to make the difference more obvious)

biomechs

Well, you only need to find the distances between these three points in 3D space, which correspond to the lengths of the triangle sides. This is an easy task. If we name these distances a, b, c then the radius R of the circumscribed circle is:

$$R= \frac {abc}{\sqrt{2a^2b^2+2b^2c^2+2c^2a^2-a^4-b^4-c^4}}$$

Thanks Greek000 - this was very helpful for me! Do you have a reference for that formula? I would like to cite something for it when I write up my work.
Thanks again!