IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 7, 2005, 5:55:45 PM (21 years ago)
Author:
Paul Price
Message:

Fixing up stuff on quaternions and rotations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibADD.tex

    r4207 r4512  
    1 %%% $Id: psLibADD.tex,v 1.76 2005-06-10 03:25:46 eugene Exp $
     1%%% $Id: psLibADD.tex,v 1.77 2005-07-08 03:55:45 price Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    14831483\begin{center}
    14841484\psfig{file=rotations.ps}
    1485 \caption{Definition of the rotation angles\label{rotations}}
     1485\caption{Definition of the rotation angles\label{rotations}.  Three
     1486rotations are performed in series: first, a rotation of $\alpha_p$ is
     1487made about the $z$ axis; second, a rotation of $\delta_p$ (not $90 -
     1488\delta_p$ as shown) is made about the modified $y$ axis, $y'$;
     1489finally, a rotation of $\phi_p$ is made about the modified $z$ axis,
     1490$z''$.  Note that it is the coordinate system that rotates, not the
     1491position of interest.}
    14861492\end{center}
    14871493\end{figure}
    14881494
    1489 \subsubsection{Quaternion Construction}
    1490 
    1491 The following describes the algorithms needed to implement 3-D
    1492 rotations in terms of quaternions. A quaternion is an ordered set of
    1493 four numbers, $\bar{q} = (q_0, q_1, q_2, q_3)$. A rotation of angle
    1494 $\theta$ about the axis defined by the unit vector $(v_x, v_y, v_z)$
    1495 has quaternion components:
    1496 \begin{eqnarray}
    1497 q_0 & = & v_x sin(\theta/2), \\
    1498 q_1 & = & v_y sin(\theta/2), \\
    1499 q_2 & = & v_z sin(\theta/2), and \\
    1500 q_3 & = & cos(\theta/2). \\
    1501 \end{eqnarray}
    1502 Note that the sine and cosine are taken of the half angle of the
     1495
     1496\subsubsection{Quaternions}
     1497
     1498A quaternion is an ordered set of four numbers, $q = (q_0, q_1, q_2,
     1499q_3)$, which is useful for specifying rotations.  A quaternion is made
     1500up of a three-vector which specifies an axis about which to rotate,
     1501and a scalar which specifies the amount of rotation.  In the
     1502following, we call the final value, $q_3$, the scalar value; note that
     1503other sources (e.g., MathWorld) may choose to call the first value the
     1504scalar value.
     1505
     1506The conjugate of a quaterion, $q = (q_0, q_1, q_2, q_3)$, is $\bar{q}
     1507= (-q_0, -q_1, -q_2, q3)$.  Note that the vector components are
     1508negated, but not the scalar component.
     1509
     1510\subsubsection{Quaternion for a position}
     1511
     1512Given an angular position on the sky, $(\alpha, \delta)$, we can
     1513construct a quaternion by treating it as a unit vector in cartesian
     1514space:
     1515\begin{eqnarray}
     1516p_0 & = & \cos \delta \cos \alpha \\
     1517p_1 & = & \cos \delta \sin \alpha \\
     1518p_2 & = & \sin \delta \\
     1519\end{eqnarray}
     1520and we set the scalar value to zero, $p_3 = 0$.
     1521
     1522Given a quaternion, $p$, we can calculate the position using the
     1523inverse of the above equations:
     1524\begin{eqnarray}
     1525\phi & = & \atan(p_1, p_0) \\
     1526\theta & = & \asin(p_2) \\
     1527\end{eqnarray}
     1528Note that in this case, we neglect the scalar component of the
     1529quaternion --- it should be zero.
     1530
     1531\subsubsection{Quaternion for a rotation}
     1532
     1533A rotation of angle $\theta$ about the axis defined by the unit vector
     1534$(v_x, v_y, v_z)$ is specified by a quaternion with components:
     1535\begin{eqnarray}
     1536r_0 & = & v_x \sin(\theta/2) \\
     1537r_1 & = & v_y \sin(\theta/2) \\
     1538r_2 & = & v_z \sin(\theta/2) \\
     1539r_3 & = & \cos(\theta/2) \\
     1540\end{eqnarray}
     1541Note that the sine and cosine are taken of the half-angle of the
    15031542rotation.  Note also that this implies that the quaternion components
    1504 are normalized such that $|\bar{q}| \equiv q_0^2 + q_1^2 + q_2^2 + q_3^2
     1543are normalized such that $|q| \equiv q_0^2 + q_1^2 + q_2^2 + q_3^2
    15051544= 1$.
    15061545
    1507 The 3-vector representation of the angle of the pole is determined
    1508 from the coordinate of the pole ($\alpha_p, \delta_p$) by:
    1509 \begin{eqnarray}
    1510 v_x & = & \cos \delta_p \cos \alpha_p \\
    1511 v_y & = & \cos \delta_p \sin \alpha_p \\
    1512 v_x & = & \sin \delta_p \\
    1513 \end{eqnarray}
    1514 
    1515 \subsubsection{Combining Two Rotations}
    1516 
    1517 Given two quaternions $\bar{a}$ and $\bar{b}$, there is a third
    1518 quaternion, $\bar{p}$, which represents the result of first applying
    1519 $\bar{a}$, and then $\bar{b}$. The components of $\bar{p}$ are given
    1520 by:
     1546\subsubsection{Multiplication of quaternions}
     1547
     1548Given two quaternions $a$ and $b$, there is a third quaternion, $p =
     1549ab$.  The components of $p$ are given by:
    15211550
    15221551\begin{eqnarray}
     
    15271556\end{eqnarray}
    15281557
     1558Note that quaternion multiplication is associative (whether you do the
     1559left pair or the right pair first doesn't matter):
     1560\begin{equation}
     1561(ab)c = a(bc)
     1562\end{equation}
     1563but not commutative (you can't switch the order of the operands):
     1564\begin{equation}
     1565abc \ne acb
     1566\end{equation}
     1567
    15291568\subsubsection{Rotating a Vector}
    15301569
    1531 You may rotate a unit vector by first constructing a quaternion
    1532 $\bar{b}$, whose first three components are the components of the
    1533 unit vector, and whose fourth component is zero. To rotate this vector
    1534 by a quaternion $\bar{a}$, you apply the formula above for combining
    1535 two quaternions. The rotated vector is found in the first three
    1536 components of the resulting quaternion, $\bar{p}$.
     1570Rotation of a position is performed by constructing the quaternion for
     1571the position, $p$, and the rotation, $r$, according to the above
     1572equations, and calculating the product:
     1573\begin{equation}
     1574q = r p \bar{r}
     1575\end{equation}
     1576$q$ is the quaternion of the result.  Note the use of the conjugate of
     1577the rotation quaternion.
     1578
     1579A general rotation may be specified by three individual rotations
     1580about a predefined set of axes.  We choose to specify rotations around
     1581the $z$, $y$ and $z$ axes, in that order.  The amount of rotation
     1582around each of these axes are known as Euler angles.  Given the Euler
     1583angles of a rotation, the rotation may be performed by rotating in
     1584turn about the designated axes.  Euler angles are specified below for
     1585the various rotations required.  To use them, the following rotation
     1586quaternions are used:
     1587
     1588\begin{itemize}
     1589\item First, about the Z axis:
     1590\begin{eqnarray}
     1591r_0 & = & 0 \\
     1592r_1 & = & 0 \\
     1593r_2 & = & \sin(\alpha_p/2) \\
     1594r_3 & = & \cos(\alpha_p/2) \\
     1595\end{eqnarray}
     1596\item Second, about the Y axis:
     1597s_0 & = & 0 \\
     1598s_1 & = & \sin(\delta_p/2) \\
     1599s_2 & = & 0 \\
     1600s_3 & = & \cos(\delta_p/2) \\
     1601\end{eqnarray}
     1602\item Finally, about the Z axis again:
     1603\begin{eqnarray}
     1604t_0 & = & 0 \\
     1605t_1 & = & 0 \\
     1606t_2 & = & \sin(\phi_p/2) \\
     1607t_3 & = & \cos(\phi_p/2) \\
     1608\end{eqnarray}
     1609
     1610These three quaternions may be multiplied together to yield the
     1611quaternion of the combined rotation: $tsr$ (note the order --- $r$ is
     1612done first, so it is nearest the position quaternion, etc.).
    15371613
    15381614\subsubsection{Rotation Matrix}
     
    16531729The appropriate values, from the Hipparcos and Tycho Catalogues are:
    16541730\begin{eqnarray}
    1655 \alpha_p & = & 282.85948^\circ \\
    1656 \delta_p & = & 62.87175^\circ \\
    1657 \phi_p & = & 32.93192^\circ \\
     1731\alpha_p & = & 180^\circ - 192.85948^\circ \\
     1732\delta_p & = & 90^\circ - 62.87175^\circ \\
     1733\phi_p & = & 90^\circ + 32.93192^\circ \\
    16581734\end{eqnarray}
    16591735
     
    16621738The appropriate values, from Zombeck, are:
    16631739\begin{eqnarray}
    1664 \alpha_p & = & 0^\circ \\
     1740\alpha_p & = & 270^\circ \\
    16651741\delta_p & = & 23^\circ27'8''.26 - 46''.845\, T - 0''.0059\, T^2 + 0''.00181\, T^3 \\
    1666 \phi_p & = & 0^\circ
     1742\phi_p & = & 90^\circ
    16671743\end{eqnarray}
    16681744where $T$ is the time in Julian centuries since 1900.
     
    16731749be rapidly calculated using the following rotation angles:
    16741750\begin{eqnarray}
    1675 \alpha_p & = & 90^\circ - (0^\circ.6406161\, T + 0^\circ.0000839\, T^2 + 0^\circ.0000050\, T^3) \\
     1751\alpha_p & = & 180^\circ + (0^\circ.6406161\, T + 0^\circ.0000839\, T^2 + 0^\circ.0000050\, T^3) \\
    16761752\delta_p & = & 0^\circ .5567530\, T - 0^\circ.0001185\, T^2 - 0^\circ.0000116\, T^3 \\
    1677 \phi_p & = & 90^\circ + 0^\circ.6406161\, T + 0^\circ.0003041\, T^2 + 0^\circ.0000051\, T^3
     1753\phi_p & = & 180^\circ + 0^\circ.6406161\, T + 0^\circ.0003041\, T^2 + 0^\circ.0000051\, T^3
    16781754\end{eqnarray}
    16791755where $T$ is $($MJD$_{\rm out} -$ MJD$_{\rm in})/36525$ is the
Note: See TracChangeset for help on using the changeset viewer.