Constructing transformation of an extended spherical movement

52 Views Asked by At

I have a frame of reference positioned on a surface of a sphere with the $z$-axis always pointing towards the center of this sphere, which is at distance $d$.

Now given:

  • spherical angle $\phi$
  • spherical angle $\theta$
  • orientation angle $\omega$ (see this link)

I want to construct the transformation which moves the frame of reference, creating a new one. This new frame of reference should always have the $z'$-axis pointing towards the center and be at distance $d$ from it. This scheme illustrates the transformation.

My idea so far:

  1. Create a sphere with diameter $d$.
  2. Find the center of the new reference frame given the spherical angles $\phi$ and $\theta$ using spherical coordinates formula.
  3. Connect the new point to the center of the sphere to get the new $z'$-axis direction.

What I am struggling with is how to include the orientation angle omega and construct the whole transformation (in some popular notation such as axis-angle, quaternions or Euler angles).

2

There are 2 best solutions below

1
On

$ \renewcommand\vec\mathbf \newcommand\vecg\boldsymbol \newcommand\unit[1]{\hat{\vec{#1}}} \newcommand\unitg[1]{\hat{\vecg{#1}}} $Place the center of your sphere at the origin. As I understand, we are specifying the position of a frame with spherical coordinates $$ x = d\cos\phi\cos\theta,\quad y = d\cos\phi\sin\theta,\quad z = d\sin\phi. $$ This may look different from the spherical coordinates you are used to because $\phi$ is measured from the $xy$-plane instead of from the $z$-axis, giving us a $90^\circ$ shift. Call the Cartesian axes (i.e. the standard basis) $\unit x, \unit y, \unit z$. It seems that your intent is for the frame with $\omega = 0$ to be specified by the (unit) spherical basis vectors $$ \unit r = -\widehat{\frac{\partial\vec r}{\partial r}} = -(\cos\phi\cos\theta)\unit x - (\cos\phi\sin\theta)\unit y - (\sin\phi)\unit z, $$$$ \unitg\phi = \widehat{\frac{\partial\vec r}{\partial\phi}} = -(\sin\phi\cos\theta)\unit x - (\sin\phi\sin\theta)\unit y + (\cos\phi)\unit z, $$$$ \unitg\theta = \widehat{\frac{\partial\vec r}{\partial\theta}} = -(\sin\phi\sin\theta)\unit x + (\cos\phi\cos\theta)\unit y. $$ (These respectively correspond to what you call $z, x, y$ in your diagram, but I prefer not to use this notation and reserve $x, y, z$ for the standard Cartesian axes.) The angle $\omega$ then performs a rotation of $\unitg\theta$ into $\unitg\phi$, meaning our frame vectors are $$ \unit r(\phi,\theta,\omega) = -(\cos\phi\cos\theta)\unit x - (\cos\phi\sin\theta)\unit y - (\sin\phi)\unit z, $$$$\begin{aligned} \unitg\phi(\phi,\theta,\omega) &= -(\sin\omega)\Bigl(-(\sin\phi\cos\theta)\unit x - (\sin\phi\sin\theta)\unit y + (\cos\phi)\unit z\Bigr) + (\cos\omega)\Bigl(-(\sin\phi\sin\theta)\unit x + (\cos\phi\cos\theta)\unit y\Bigr) \\ &= (\sin\omega\sin\phi\cos\theta-\cos\omega\sin\phi\sin\theta)\unit x + (\sin\omega\sin\phi\sin\theta+\cos\omega\cos\phi\cos\theta)\unit y - (\cos\omega\cos\phi\cos\theta)\unit z \end{aligned}$$$$\begin{aligned} \unitg\theta(\phi,\theta,\omega) &= (\cos\omega)\Bigl(-(\sin\phi\cos\theta)\unit x - (\sin\phi\sin\theta)\unit y + (\cos\phi)\unit z\Bigr) + (\sin\omega)\Bigl(-(\sin\phi\sin\theta)\unit x + (\cos\phi\cos\theta)\unit y\Bigr) \\ &= -(\cos\omega\sin\phi\cos\theta+\sin\omega\sin\phi\sin\theta)\unit x + (\sin\omega\cos\phi\cos\theta-\cos\omega\sin\phi\sin\theta)\unit y + (\cos\omega\cos\phi)\unit z \end{aligned}$$ Thus we have a rotation matrix from the $(0,0,0)$-frame $-\unit x, \unit z, \unit y$ given by $$\begin{pmatrix} \cos\phi\cos\theta & -\cos\omega\sin\phi\cos\theta - \sin\omega\sin\phi\sin\theta & \sin\omega\sin\phi\cos\theta-\cos\omega\sin\phi\sin\theta \\ \cos\phi\sin\theta & \sin\omega\cos\phi\cos\theta-\cos\omega\sin\phi\sin\theta & \sin\omega\sin\phi\sin\theta+\cos\omega\cos\phi\cos\theta \\ \sin\phi & \cos\omega\cos\phi & -\cos\omega\cos\phi\cos\theta \end{pmatrix}.$$

0
On

The unit sphere can be parameterized using $\varphi$ and $\theta$ as specified in the attached figure as follows

$ \mathbf{p} = ( \cos \varphi \cos \theta, \cos \varphi \sin \theta, \sin \varphi)$

Since the $\mathbf{z'}$ axis points from $\mathbf{p}$ to the origin, then it is given by

$ \mathbf{z'} = - \mathbf{p} $

To build a right handed coordinate system, we can choose two unit vectors $\mathbf{u_1}$ and $\mathbf{u_2}$ such that $\mathbf{z'} = \mathbf{u_1} \times \mathbf{u_2} $

Once possible choice is

$ \mathbf{u_1} = - \dfrac{1}{\cos \phi} \dfrac{ \partial \mathbf{p} }{ \partial \theta } = (\sin \theta , - \cos \theta , 0 ) $

and

$ \mathbf{u_2} = \dfrac{ \partial \mathbf{p}}{ \partial \varphi} = (- \sin \varphi \cos \theta, - \sin \varphi \sin \theta, \cos \varphi ) $

Now to specify $\mathbf{x'}$ and $\mathbf{y'}$, we use $\omega$, which specifies the amount of rotation of $\mathbf{x'}$ and $\mathbf{y'}$ with respect to $\mathbf{u_1}$ and $\mathbf{u_2}$, respectively. This is given as follows:

$\mathbf{x'} = \cos \omega \ \mathbf{u_1} + \sin \omega \ \mathbf{u_2} $

and

$ \mathbf{y'} = - \sin \omega \ \mathbf{u_1} + \cos \omega \ \mathbf{u_2} $

Hence the frame attached to point $\mathbf{q} = d \mathbf{p} $ is specified as follows

$ \mathbf{r} = \mathbf{q} + R \mathbf{u} $

Here, $\mathbf{r}$ is the world position vector, while $\mathbf{u}$ is the local position vector. And $\mathbf{R} $ is given by

$ R = [\mathbf{x'}, \mathbf{y'}, \mathbf{z'} ] = R_1 R_{z'} $

with

$R_1 = [\mathbf{u_1}, \mathbf{u_2}, \mathbf{z'}] = \begin{bmatrix} \sin \theta && -\sin \varphi \cos \theta && -\cos \varphi \cos \theta \\ - \cos \theta && - \sin \varphi \sin \theta && -\cos \varphi \sin \theta \\ 0 && \cos \varphi && -\sin \varphi \end{bmatrix}$

and

$ R_{z'} = \begin{bmatrix} \cos \omega && - \sin \omega && 0 \\ \sin \omega && \cos \omega && 0 \\ 0 && 0 && 1 \end{bmatrix} $

Now, if you have an "initial" frame of reference, specified by $\mathbf{q_i} $ and $R_i$ as given above, and want to move it to a "final" frame of reference, specified by $\mathbf{q_f}$ and $R_f$, then first shift the initial frame by $ \mathbf{q_f} - \mathbf{q_i} $, this will give an intermediate frame of reference specified by $ \mathbf{q_f} $ and $\mathbf{R_i} $, now apply a rotation of this frame about $\mathbf{q_f}$ (in the world reference frame) using the rotation matrix $ R_f R_i^T $, and this will give you the desired final frame of reference. Here $T$ denotes taking the transpose of the matrix $R_i$. The effect of this is to preserve the origin of the intermediate frame at $\mathbf{q_f}$ and then resetting (or cancelling) the frame orientation $R_i$ by pre-multiplying it by $R_i^T$ and finally setting the new orientation of the axes as specified by $R_f$.