Expressing a circle in 3d space in terms of its extrema

153 Views Asked by At
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.

2

There are 2 best solutions below

8
On BEST ANSWER

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:

enter image description here

enter image description here

0
On

Here is a different but complementary approach to '@Hosam Hajeer', which might be helpful.

We have a Euclidean 3D-space with axes 'X', 'Y', and 'Z', and orthonormal basis set $ \mathbf{V_1} = (1,0,0)^T $, $ \mathbf{V_2} = (0,1,0)^T $, and $ \mathbf{V_3} = (0,0,1)^T $. Applying two consecutive rotations to the basis set produces a new basis set: $ \mathbf{V} $, $ \mathbf{W} $ and $ \mathbf{N} $. The rotation matrices are: \begin{align*} R_y(\theta) = \begin{pmatrix} \cos(\theta) & 0 & \sin(\theta) \\ 0 & 1 & 0 \\ -\sin(\theta) & 0 & \cos(\theta) \end{pmatrix} \text{, and} \hspace{2mm} R_z(\phi) = \begin{pmatrix} \cos(\phi) & -\sin(\phi) & 0 \\ \sin(\phi) & \cos(\phi) & 0 \\ 0 & 0 & 1 \end{pmatrix} \end{align*} and the new (rotated) orthonormal basis set is: \begin{eqnarray*} \mathbf{V} &=& R_z(\phi) R_y(\theta)\mathbf{V_1} = \begin{pmatrix} \cos(\phi)\cos(\theta) \\ \sin(\phi)\cos(\theta) \\ -\sin(\theta) \end{pmatrix} \\ \mathbf{W} &=& R_z(\phi) R_y(\theta)\mathbf{V_2} = \begin{pmatrix} -\sin(\phi) \\ \cos(\phi) \\ 0 \end{pmatrix} \\ \mathbf{N} &=& R_z(\phi) R_y(\theta)\mathbf{V_3} = \begin{pmatrix} \cos(\phi)\sin(\theta) \\ \sin(\phi)\sin(\theta) \\ \cos(\theta) \end{pmatrix} \end{eqnarray*}

A circle of radius $R$, centered at $\mathbf{c}$, and lying on the plane spanned by $ \mathbf{V} $ and $ \mathbf{W} $ is \begin{equation} P(t) = \mathbf{c} + R( \cos(t) \mathbf{V} + \sin(t) \mathbf{W}), \quad t \in [0, 2\pi) \hspace{25mm} \text{(1)} \end{equation} The parametric variable '$t$' can be considered "time"; we imagine a 3D-point $ P(t) = (x(t), y(t), z(t))^T $ traveling along the circle through time. As it travels, each of its coordinates passes through a minimum and a maximum, at times that are obtained by setting the first derivative of $P(t)$ to zero and solving for '$t$'. For each coordinate, the equation to be solved has the form: $ -a \hspace{1mm} \sin(t) + \hspace{1mm} b \hspace{1mm} \cos(t)) = 0$, where '$a$' and '$b$' are trigonometric functions not involving '$t$' (they are each a respective element of $\mathbf{V}$ and $\mathbf{W}$). The solution is: \begin{equation*} t = \arctan(\frac{b}{a}) + n\pi, \quad n \in [0,\mathbb{N}) \end{equation*} Set $n=0$ to identify the first revolution of $P$ around the circle. Note that '$t+\pi$' is also a solution because $\sin(t + \pi) = -\sin(t)$ and $\cos(t + \pi) = -\cos(t)$. So, within a revolution, there are two times when the first derivative is zero, which makes sense given the "ellipsoid" nature of equation (1). Substituting these two solutions for '$t$' back into equation (1) yields these generic formulas for the two extrema of a coordinate: \begin{align*} & c + R \hspace{1mm} a \hspace{1mm} \cos(\arctan(\frac{b}{a})) + R \hspace{1mm} b \hspace{1mm} \sin(\arctan(\frac{b}{a})) &= c + R \sqrt{a^2 + b^2} \\ \text{and} \quad & c + R \hspace{1mm} a \hspace{1mm} \cos(\arctan(\frac{b}{a})+ \pi) + R \hspace{1mm} b \hspace{1mm} \sin(\arctan(\frac{b}{a})+ \pi) &= c - R \sqrt{a^2 + b^2} \end{align*} The values for '$a$' and '$b$' for each coordinate are supplied at the appropriate row of $ \mathbf{V} $ and $ \mathbf{W} $. So, we have: \begin{align*} x_{\text{min}} &= c_x - R \sqrt{(\cos(\phi)\cos(\theta))^2 + (-\sin(\phi))^2} \\ y_{\text{min}} &= c_y - R \sqrt{(\sin(\phi)\cos(\theta))^2 + (\cos(\phi))^2} \\ z_{\text{min}} &= c_z - R \sqrt{(-\sin(\theta))^2} \end{align*} The solutions and results already presented by '@Hosam Hajeer' follow from here. But I can add one additional result, making it easier to obtain the radius: \begin{equation*} (x_{\text{min}} - c_x)^2 + (y_{\text{min}} - c_y)^2 + (z_{\text{min}} - c_z)^2 = 2 R^2 \end{equation*}