I want to define a circle in 3D-space by its extremal points (maxima and minima) with respect the three coordinate axes.
I have tried unsuccessfully to express this as a mathematical formulation that can be solved. I will outline how far I have gotten.
My approach has been to imagine a "box" defined by six planes:
- Two planes parallel to the YZ-plane: $x = x_{\text{min}}$ and $x = x_{\text{max}}$.
- Two planes parallel to the XZ-plane: $y = y_{\text{min}}$ and $y = y_{\text{max}}$.
- Two planes parallel to the XY-plane: $z = z_{\text{min}}$ and $z = z_{\text{max}}$.
The box is centered at the origin, i.e., $x_{\text{min}} = -x_{\text{max}}$, $y_{\text{min}} = -y_{\text{max}}$, and $z_{\text{min}} = -z_{\text{max}}$.
Imagine also a 2D-sphere centered at the origin with radius $r$, as well as a 2D-plane through the origin (center of the sphere). A great circle is formed by the intersection of the sphere and the plane. My questions are:
- How can I specify the plane and sphere, in order that the great circle touches each of the six sides of the box exactly once?
- Is that circle unique, or can many circles fulfill these conditions?
I see that the plane must intersect each of the box sides exactly once, and that the intersection points $(x_{\text{min}}, y, z)$, $(x_{\text{max}}, y, z)$, $(x, y_{\text{min}}, z)$, $(x, y_{\text{max}}, z)$, $(x, y, z_{\text{min}})$, and $(x, y, z_{\text{max}})$ must satisfy both the plane equation and the sphere equation. In other words, for each intersection point $(x_i, y_i, z_i)$ (where $x_i$ is one of $x_{\text{min}}$ or $x_{\text{max}}$, $y_i$ is one of $y_{\text{min}}$ or $y_{\text{max}}$, and $z_i$ is one of $z_{\text{min}}$ or $z_{\text{max}}$), the following must hold:
- $x_i^2 + y_i^2 + z_i^2 = r^2$ (point lies on the sphere).
- $Ax_i + By_i + Cz_i = 0$ (point lies on the plane, where $A$, $B$, and $C$ are coefficients of the Cartesian plane equation).
So, another way to ask the question might be:
Can $r$, $A$, $B$, and $C$ be expressed in terms of the extrema: $x_{\text{min}}, x_{\text{max}}, y_{\text{min}}, y_{\text{max}}, z_{\text{min}}$, and $z_{\text{max}}$ ?
Any help, guidance or assistance would be appreciated.
A circle in $3D$ is given by
$ p(t) = C + R ( V \cos t + W \sin t ) \tag{1}$
where $C = (c_1, c_2, c_3)$ is the $3D$ center of the circle, and
are mutually orthogonal unit vectors.
From the statement of your question, you know the $x, y, z$ limits of your circle. These limits immediately specify the $3D$ center of the circle as follows
$ c_1 = \dfrac{1}{2} (x_{min} + x_{max} ) \tag{2}$
$ c_2 = \dfrac{1}{2} ( y_{min} + y_{max} ) \tag{3}$
$ c_3 = \dfrac{1}{2} ( z_{min} + z_{max} ) \tag{4}$
Now suppose the unit normal vector to the plane of the circle is given by
$ N = (n_1, n_2, n_3) = (\sin \theta \cos \phi, \sin \theta \sin \phi, \cos \theta ) \tag{5}$
Orthogonal unit vectors to $N$ that are also mutually orthogonal to each other are given by
$ V = ( \cos \theta \cos \phi, \cos \theta \sin \phi, - \sin \theta ) \tag{6}$
$ W = ( - \sin \phi, \cos \phi, 0 ) \tag{7}$
From this
$ x_{max} - x_{min} = 2 R \sqrt{ \cos^2 \theta \cos^2 \phi + \sin^2 \phi }\tag{8}$
$ y_{max} - y_{min} = 2 R \sqrt{ \cos^2 \theta \sin^2 \phi + \cos^2 \phi }\tag{9}$
$ z_{max} - z_{min} = 2 R | \sin \theta | \tag{10} $
Eliminating $R$ by cross multiplication, we get
$ \dfrac{\left( x_{max} - x_{min} \right) }{\left( z_{max} - z_{min} \right)} = \dfrac{\sqrt{ \cos^2 \theta \cos^2 \phi + \sin^2 \phi }}{ \sin \theta }\tag{11}$
and
$ \dfrac{\left( y_{max} - y_{min} \right) }{\left( z_{max} - z_{min} \right)} = \dfrac{ \sqrt{ \cos^2 \theta \sin^2 \phi + \cos^2 \phi } }{\sin \theta} \tag{12}$
Squaring both equations and adding, gives us
$ \dfrac{\left( x_{max} - x_{min} \right)^2 + \left( y_{max} - y_{min} \right)^2} {\left( z_{max} - z_{min} \right)^2} = \dfrac{\cos^2 \theta + 1 }{\sin^2 \theta} = 2 \csc^2\theta - 1\tag{13} $
And this determines $\theta$. There will two values of $\theta$ one positive and one negative. Because we want $\cos \theta \ge 0$.
Now, from equation $(10)$ , we can determine $R$. Then from equations $(8)$ and $(9)$ we have
$ \dfrac{ (x_{max} - x_{min} )^2 }{(y_{max} - y_{min} )^2 } = \dfrac{ \cos^2 \theta \cos^2 \phi + \sin^2 \phi }{ \cos^2 \theta \sin^2 \phi + \cos^2 \phi } = \dfrac{ \cos^2 \theta + \tan^2 \phi }{\cos^2 \theta \tan^2 \phi + 1 } \tag{14} $
So that
$\tan^2 \phi = \dfrac{ \cos^2 \theta (y_{max} - y_{min})^2 - (x_{max} - x_{min} )^2 }{ \cos^2 \theta (x_{max} - x_{min})^2 - (y_{max} - y_{min})^2 } \tag{15}$
and this gives two possible values for $\phi$.
So there are four different circles in $3D$ that can have the same limits in $x$, $y$ and $z$.
Therefore, the sphere that you're looking for is given by
$ (x - c_1)^2 + (y - c_2)^2 + (z - c_3)^2 = R^2 \tag{16} $
and the plane is the plane in which the circle lies which is
$ N \cdot ( (x - c_1) , (y - c_2), (z- c_3) ) = 0 \tag{17}$
i.e.
$ n_1 (x - c_1) + n_2 (y - c_2) + n_3 (z - c_3) = 0 \tag{18} $
Numerical Example:
Suppose that you're given that
$ x_{min} = 1 , \ x_{max} = 7 $
$ y_{min} = 3, \ y_{max} = 11 $
$ z_{min} = 1 , \ z_{max} = 8 $
Then from equations $(2), (3), (4)$ , the center of the circle (and the sphere ) is
$ C = (4, 7, 4.5 ) $
From equation $(13)$
$ \dfrac{2}{\sin^2 \theta} - 1 = \dfrac{ 6 ^ 2 + 8^2 }{ 7^2} = \dfrac{100}{49} $
Hence,
$ \dfrac{2}{\sin^2 \theta} = \dfrac{149}{49} $
So that,
$ \sin \theta = \pm \sqrt{ \dfrac{98}{149} } \approx \pm 0.811 $
From which
$ \theta \approx \pm 54.1936^\circ $
Substituting into equation $(10)$, we get
$ R = \dfrac{z_{max} - z_{min} } { 2 |\sin \theta| } \approx 4.31566 $
From equations $(15)$, we have
$ \tan^2 \phi = 0.27273 $
So that
$ \tan \phi = \pm 0.522236 $
From which
$ \phi = \pm 27.575^\circ $
Therefore, the four normal vectors to the four circles are
$ N_1 = ( \sin(54.1936^\circ) \cos (27.575^\circ) , \sin (54.1936^\circ) \sin(27.575^\circ) , \cos(54.1936^\circ) )$
$ N_2 = ( \sin(54.1936^\circ) \cos (-27.575^\circ) , \sin (54.1936^\circ) \sin(-27.575^\circ) , \cos(54.1936^\circ) )$
$ N_3 = ( -\sin(54.1936^\circ) \cos (27.575^\circ) , -\sin (54.1936^\circ) \sin(27.575^\circ) , \cos(54.1936^\circ) )$
$ N_4 = ( -\sin(54.1936^\circ) \cos (-27.575^\circ) , -\sin (54.1936^\circ) \sin(-27.575^\circ) , \cos(54.1936^\circ) )$
Numerically, these are
$ N_1 = (0.71887, 0.37542 , 0.58505 ) $
$ N_2 = (0.71887, -0.37542, 0.58505 ) $
$ N_3 = (-0.71887, -0.37542, 0.58505) $
$ N_4 = (- 0.71887, 0.37542, 0.58505) $
The corresponding $V$'s and $W$'s are
$ V_1 = (0.51859, 0.27082, -0.811 ), W_1 = (- 0.4629, 0.8864 , 0) $
$ V_2 = (0.51859, -0.27082, -0.811 ) , W_2 = (0.4629, 0.8864 , 0)$
$ V_3 = (0.51859, 0.27082, 0.811 ) , W_3 = (-0.4629, 0.8864, 0) $
$ V_4 = (0.51859, -0.27082, 0.811) , W_4 = (0.4629, 0.8864, 0 ) $
Taking the radius $R = 4.31566$ into consideration, we get
$ x_1 = C_x - (4.31566) \sqrt{ 0.51859^2 + 0.4629^2 } = 4 - 3 = 1 = x_{min} $
$ x_2 = C_x + (4.31566) \sqrt{ 0.51859^2 + 0.4629^2} = 4 + 3 = 7 = x_{max}$
$ y_1 = C_y - (4.31566) \sqrt{ 0.27082^2 + 0.8864^2 } = 7 - 4 = 3 = y_{min}$
$ y_2 = 7 + 4 = 11 = y_{max} $
$ z_1 = C_z - 4.31566 (0.811) = 4.5 - 3.5 = 1 = z_{min} $
$ z_2 = C_z + 4.31566 (0.811) = 4.5 + 3.5 = 8 = z_{max} $
Here is what the four circles look like: