3D coordinates of circle center given three point on the circle. Given the three coordinates $(x_1, y_1, z_1)$, $(x_2, y_2, z_2)$, $(x_3, y_3, z_3)$ defining a circle in 3D space, how to find the coordinates of the center of the circle $(x_0, y_0, z_0)$?

Let's assume the circle is defined by the 3 points a, b and c, and that the center is denoted d. Following the hints in the answers above the coordinates of points a, b and c can be plugged into the equation of a circle. 3 circle equations and 4 unknowns (3 coordinates of the center c plus the radius) means that we have 2 remaining unknowns for one equation. This equation in fact represents the line passing through the center of the circle, having equal distance to points a, b and c. Intersecting this line with the plane spanned by a, b and c gives the point c. The rest is algebra, making use of some smart substitution of variables:
        Cx = bx-ax
        Cy = by-ay
        Cz = bz-az
        Bx = cx-ax
        By = cy-ay
        Bz = cz-az
        B2 = ax**2-cx**2+ay**2-cy**2+az**2-cz**2
        C2 = ax**2-bx**2+ay**2-by**2+az**2-bz**2

        CByz = Cy*Bz-Cz*By
        CBxz = Cx*Bz-Cz*Bx
        CBxy = Cx*By-Cy*Bx
        ZZ1 = -(Bz-Cz*Bx/Cx)/(By-Cy*Bx/Cx)
        Z01 = -(B2-Bx/Cx*C2)/(2*(By-Cy*Bx/Cx))
        ZZ2 = -(ZZ1*Cy+Cz)/Cx
        Z02 = -(2*Z01*Cy+C2)/(2*Cx)

and finally the coordinates of the center:
        dz = -((Z02-ax)*CByz-(Z01-ay)*CBxz-az*CBxy)/(ZZ2*CByz-ZZ1*CBxz+CBxy)
        dx = ZZ2*dz + Z02
        dy = ZZ1*dz + Z01

