edit2: It turns out that there is no logic error in this question and in fact, the method used works just fine. The reason I thought it didn't work was that I had failed to normalize one of my basis vectors. However, I learned a little about better ways to do this.
edit: This is a regular tetrahedron only. Also, when I mention rotation below, I don't mean math rotation (which i know how to do), but rather, I rotated it in a graphic, since I am not really doing anything with the rotated figure.
I made up the following problem. My answer does not work. Either my radius is wrong (likely) or my circle center point is wrong.
Given a spherical radius, $r_{s},$ and a point, $P$, on the surface of an "origin centered" sphere, find the parametric equation of a circle on the sphere such that any point on the circle can be the second point of a tetrahedron. Of course, all three other points will be on that circle.
My question is "Where is the logic error?"
I am fine with doing this with values for the variables, so long as it can be done with any $r_s$ and $P.$
Sphere: $x^2+y^2+z^2=r_s^2$
Let $P=(3,2,1)$
Let $r_s=\sqrt{14}$
If $P$ is a point on the sphere, we can imagine that $P$ is at the north pole and we rotate the sphere until an unknown tetrahedral point, $Q$, is in the same plane as $P$ and the origin. That gives this two dimensional image.
Note: $r_s = \vert \mathbf{n} \vert$ and $C_P$ means center point.
Note that this image does not define point $Q$. However, point $B'$ and radius $R$ should be adequate to draw a circle.
We know the central angle, $\theta=\arccos(-1/3)$ of a tetrahedron. Consequently we know angle $\gamma=\pi-\theta.$ Since we have imagined the plane for the three other tetrahedral points, we can calculate the distance to its center as $b=r_{s}\cos(\gamma).$ Then, the center of the circle will be $B'=b\cdot\mathbf{n'}$ where $\mathbf{n'}$ is the unit vector opposite of $\mathbf{n}.$ That is, $\mathbf{n'}$ is a direction vector pointing opposite of the direction to $P.$ We will also need the radius of that circle, which is $R=r_{s}\sin(\gamma).$
So far, we have been computing values based on an imaginary rotation of the sphere, but in order to get the circle equation, we need to know basis vectors for the plane of our circle. We already know that $\mathbf{n}$ and $\mathbf{n'}$ are normals to the circle. Therefore, a vector in the plane will be $\mathbf{u=}(-\mathbf{n_{y}},\mathbf{n_{x}},0).$ To get another basis vector, we can form the cross product $\mathbf{v}=\mathbf{n'}\otimes\mathbf{u}.$
$$Circle:\quad\left[\begin{array}{c}
x\\
y\\
z
\end{array}\right]=\mathbf{B'}+R\cdot cos\phi\cdot\mathbf{u}+R\cdot sin\phi\cdot\mathbf{v}\qquad0\le\phi\le2\pi$$
Result: The circle equation works fine and draws a circle with center $B'$. However, radius $R$ does not usually quite reach to the sphere surface.
I have tried quite a few numerical examples in Geogebra where I know the surrounding sphere and all 4 tetrahedral points.
I have also tried to predict a 2nd tetrahedral point, $Q,$ using $\beta$ the angle between x-axis and vector $\mathbf{n}.$
$$\mathbf{a_x}=(1,0,0)$$
$$\beta = \cos^{-1}\left( \frac{\mathbf{n}\cdot \mathbf{a_x}}{\vert \mathbf{n} \vert \cdot \vert \mathbf{a_x} \vert} \right)$$
$$Q=r_s\left( \cos(\theta_1+\beta), \sin(\theta_1+\beta),0 \right)$$
These equations seem to predict correctly a 2nd tetrahedral point, but I don't know how to predict two more based solely on the values given so far.
Best Answer
Suppose you want to find the parametric equation of the circle passing through points A, B, C which you already know the coordinates of. This is the circumcircle of $\triangle ABC$. First you need to find the normal to the plane of the circle, which is along $v= (C - A) \times (B - A) $. Normalize it producing $n = \dfrac{v}{|v|} $
The center of the circle $O$ is on the perpendicular bisector of $AB$ and of $AC$, so find the two vectors
$u_1 = n \times (B - A) $ and $u_2 = n \times (C - A) $
Then the center is the solution of
$O = \frac{1}{2} (A + B) + t u_1 = \frac{1}{2} (A + C) + s u_2 $
This is a $3 \times 2$ system of equations in the variables $t, s$ which can be solved very easily, thus determining the center $O$.
Next, the radius $R$ is the circle is given $R = | O - A | = | O - B | = | O - C | $
Now the parametric equation is
$ p(t) = O + R v_1 \cos t + R v_2 \sin t $
where $v_1, v_2, n$ are normal to each other and of unit length.
The above described procedure is good for any three points $A, B, C$. In the case where these three points are vertices of a regular tetrahedron, then, the center of the circle is simply
$O = \frac{1}{3} (A + B + C) $
but we still have to compute the normal to the plane of the circle as described above.
Edit:
After a comment from the OP, that points $A, B, C$ are not available, and that what's available is the fourth vertex $D$ and the centroid of the tetrahedron $G$. In this case:
The center of the face opposing vertex $D$ (which is the face containing vertices $A, B, C$) is located at $O = G - \frac{1}{3} GD $
The normal to the face $ABC$ is along $GD$
The radius can be found as follows
$R = \sqrt{ |GD|^2 - \left(\frac{1}{3} |GD| \right)^2 } = \dfrac{\sqrt{8}}{3} | GD | $