# Thread: equasion os a circle given 3 points

1. ## equasion os a circle given 3 points

hi all
for any 3 points in 3d space. (x1,y1,z1) etc there is a unique circle that can be drawn throught then. I have spent many hours trying to derive the equasion of that circle so that I can then find the intersection of the plane Y=a and that circle but have not got anything clean, the approach that I have tried is to translate and rotate the coordinate system so that the 3 points all lie on the plane z=0 then use a reverse transformation to get the actual intersection, this is horendous does anyone have a better approach, any assistance would be of help I'm stumped

2. First, you may wish to demonstrate that the basic premise is false.

Try (0,0,0), (1,0,0), and (2,0,0)

Write a new definition of the problem and maybe there's a way to proceed.

3. For three non-collinear points there is a unique circle passing through them.

4. Originally Posted by cptn_gnd
hi all
for any 3 points in 3d space. (x1,y1,z1) etc there is a unique circle that can be drawn throught then. I have spent many hours trying to derive the equasion of that circle so that I can then find the intersection of the plane Y=a and that circle but have not got anything clean, the approach that I have tried is to translate and rotate the coordinate system so that the 3 points all lie on the plane z=0 then use a reverse transformation to get the actual intersection, this is horendous does anyone have a better approach, any assistance would be of help I'm stumped
There's no real short cut to this, but it's doable if you use vectors and the vector cross product.

Denote by v_1, v_2 and v_3 the position vectors of the three points. Then $\displaystyle (v_1-v_2)\times(v_1-v_3)$ will be a vector in the direction normal to the plane of the circle. Form this cross product, and divide by its length to get a unit vector w normal to the circle.

Next, notice that for any real number λ, the vector $\displaystyle \textstyle\frac12(v_1+v_2) + \lambda(v_2-v_1)\times w$ represents a point on the perpendicular bisector of the line joining v_1 and v_2 (in the plane of the circle). Similarly, for any μ, $\displaystyle \textstyle\frac12(v_1+v_3) + \mu(v_3-v_1)\times w$ is a point on the perpendicular bisector of the line joining v_1 and v_3 (in the plane of the circle). You can solve the equation $\displaystyle \textstyle\frac12(v_1+v_2) + \lambda(v_2-v_1)\times w = \frac12(v_1+v_3) + \mu(v_3-v_1)\times w,$ finding λ and μ by comparing the three coordinates of the vectors in that equation. The vector $\displaystyle \textstyle c = \frac12(v_1+v_2) + \lambda(v_2-v_1)\times w = \frac12(v_1+v_3) + \lambda(v_3-v_1)\times w$ is the centre of the circle. (The equation will have a solution whenever the three vectors v_1, v_2 and v_3 are non-collinear.)

Then $\displaystyle c-v_1$ is a vector from the centre to a point on the circle, and $\displaystyle u = (c-v_1)\times w$ is a perpendicular vector from the centre to a point on the circle. So the equation of the circle is given parametrically as the locus of the vector $\displaystyle p = c+(c-v_1)\cos\theta + u\sin\theta$.

If you want to know where the circle cuts the plane y=a, all you have to do is to set the y-coordinate of p equal to a, and solve for θ.

5. Let $\displaystyle (x_1,y_1),(x_2,y_2),(x_3,y_3)$ be three distinct non-collinear points.
There is a circle, $\displaystyle a(x^2+y^2)+bx+cy+d=0$ ($\displaystyle a\not =0$) passing through all three points.

By substituting the points (here $\displaystyle x,y$ are arbitrary point on circle) we get:
$\displaystyle a(x^2+y^2)+bx+cy+d=0$
$\displaystyle a(x_1^2+y_1^2)+bx_1+cy_1+d=0$
$\displaystyle a(x_2^2+y_2^2)+bx_2+cy_2+d=0$
$\displaystyle a(x_3^2+y_3^2)+bx_3+cy_3+d=0$

This is a homogenous system for $\displaystyle a,b,c,d$, it has non-trivial solutions.
This means,
$\displaystyle \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^3&x_3&y_3&1 \end{array}\right| = 0$.

Evaluating the determinant will give you the equation of the circle.

Note, this method generalizes to all conics: lines, parabolas, ellipses,....
But computing that determinant is a nightmare, it gets even more horrific with higher order conics, so unless you got a computer program stay away.

6. ## 3D extension to PerfectHacker's elegant solution

PerfectHacker's solution is very elegant in 2 dimensions. It is easily extended to 3 dimensions (origional problem).

We first demonstrate that the equation of the 3D circle is of the form:

a(x^2 + y^2 + z^2) + bx + cy + d = 0 - (1)

then perfectHacker's solution is easily extended. There is one more part to this though. We need to use this technique to find the plane containing the points:

| x y z 1 |
| x1 y1 z1 1 |
| x2 y2 z2 1 | = 0 - (2)
| x3 y3 z3 1 |

Thus z can be expressed as a linear function of x and y (being on the plane)
and eliminating z in the circle equation, one gets a projection of that circle in X-Y space (an ellipse). From this, one can solve for y as a function of x (two roots of the quadratic), and use its value in the plane equation to also find z in terms of x.

The only part left for me is to explain how I got the form of the circle in equation (1).

There are an infinite number of spheres containing the 3 points on its surface. (imagine any sphere with a large enough radius..it can be moved so that the 3 points touch it).

Equation for the sphere is (vec X - vec R)^2 = r^2 where vec R is the center of the circle, and vec X is the locus of all points on its surface. This is of the form:

x^2 + y+2 + z^2 + gx + hy + iz + j = 0

Since the points lie on a plane, one can expres z as a linear function of x and y, thus obtaining the form as in equation (1)

QED