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

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