Forgot password?
 Register account
View 193|Reply 1

[几何] Rodrigues' rotation formula

[Copy link]

3159

Threads

7941

Posts

610K

Credits

Credits
63770
QQ

Show all posts

hbghlyj Posted 2022-8-19 05:21 |Read mode
Wikipedia
        If $\mathbf v$ is a vector in $\mathbb R^3$ and $\mathbf k$ is a unit vector describing an axis of rotation about which $\mathbf v$ rotates by an angle $\theta$ according to the right hand rule,
the Rodrigues formula for the rotated vector $\mathbf v_{\rm rot}$ is
$\mathbf {v} _{\mathrm {rot} }=\mathbf {v} \cos \theta +(\mathbf {k} \times \mathbf {v} )\sin \theta +\mathbf {k} ~(\mathbf {k} \cdot \mathbf {v} )(1-\cos \theta )$
The intuition of the above formula is that the first term scales the vector down, while the second skews it (via vector addition) toward the new rotational position. The third term re-adds the height (relative to $\textbf{k}$) that was lost by the first term.
An alternative statement is to write the axis vector as a cross product $\mathbf a ×\mathbf b$ of any two nonzero vectors $\mathbf a$ and $\mathbf b$ which define the plane of rotation, and the sense of the angle $\theta$ is measured away from $\mathbf a$ and towards $\mathbf b$. Letting $\alpha$ denote the angle between these vectors, the two angles $\theta$ and $\alpha$ are not necessarily equal, but they are measured in the same sense. Then the unit axis vector can be written $$\mathbf{k} = \frac{\mathbf{a}\times\mathbf{b}}{|\mathbf{a}\times\mathbf{b}|} = \frac{\mathbf{a}\times\mathbf{b}}{|\mathbf{a}||\mathbf{b}|\sin\alpha}$$ This form may be more useful when two vectors defining a plane are involved. An example in physics is the Thomas precession which includes the rotation given by Rodrigues' formula, in terms of two non-collinear boost velocities, and the axis of rotation is perpendicular to their plane.

Derivation

k v v v w vrot θ Let $\mathbf k$ be a unit vector defining a rotation axis, and let $\mathbf v$ be any vector to rotate about $\mathbf k$ by angle $\theta$ (right hand rule, anticlockwise in the figure). Using the dot and cross products, the vector $\mathbf v$ can be decomposed into components parallel and perpendicular to the axis $\mathbf k$,$$\mathbf{v} = \mathbf{v}_\parallel + \mathbf{v}_\perp$$ where the component parallel to $\mathbf k$ is $\mathbf{v}_\parallel = (\mathbf{v} \cdot \mathbf{k}) \mathbf{k}$ called the vector projection of $\mathbf v$ on $\mathbf k$, and the component perpendicular to $k$ is $$\mathbf{v}_{\perp} = \mathbf{v} - \mathbf{v}_{\parallel} = \mathbf{v} - (\mathbf{k} \cdot \mathbf{v}) \mathbf{k} = - \mathbf{k}\times(\mathbf{k}\times\mathbf{v})$$ called the vector rejection of $\mathbf v$ from $\mathbf k$.
The vector $\mathbf k×\mathbf v$ can be viewed as a copy of $\mathbf v_⊥$ rotated anticlockwise by 90° about $\mathbf k$, so their magnitudes are equal but directions are perpendicular. Likewise the vector $\mathbf k × (\mathbf k ×\mathbf v)$ a copy of $\mathbf v_⊥$ rotated anticlockwise through 180° about $\mathbf k$, so that $\mathbf k× (\mathbf k×\mathbf v)$ and $\mathbf v_{⊥}$ are equal in magnitude but in opposite directions (i.e. they are negatives of each other, hence the minus sign).
Expanding the vector triple product establishes the connection between the parallel and perpendicular components, for reference the formula is $\mathbf a × (\mathbf b × \mathbf c) = (\mathbf a ·\mathbf c)\mathbf b − (\mathbf a ·\mathbf b)\mathbf c$ given any three vectors $\mathbf a$, $\mathbf b$, $\mathbf c$.
The component parallel to the axis will not change magnitude nor direction under the rotation, $$\mathbf{v}_{\parallel\mathrm{rot}} = \mathbf{v}_\parallel $$ only the perpendicular component will change direction but retain its magnitude, according to \begin{align*} \left|\mathbf{v}_{\perp\mathrm{rot}}\right| &= \left|\mathbf{v}_\perp\right| \\ \mathbf{v}_{\perp\mathrm{rot}} &= \mathbf{v}_\perp \cos\theta+ \mathbf{k}\times\mathbf{v}_\perp\sin\theta \end{align*} and since $\mathbf k$ and $\mathbf v_{∥}$ are parallel, their cross product is zero $\mathbf k ×\mathbf v_{∥} = 0$, so that $$\mathbf{k} \times \mathbf{v}_\perp = \mathbf{k} \times \left(\mathbf{v} - \mathbf{v}_{\parallel}\right) = \mathbf{k} \times \mathbf{v} - \mathbf{k} \times \mathbf{v}_{\parallel} = \mathbf{k} \times \mathbf{v}$$ and it follows $$\mathbf{v}_{\perp\mathrm{rot}} = \mathbf{v}_\perp \cos\theta + \mathbf{k}\times\mathbf{v}\sin\theta $$ v v = k ( k v ) v = k ×( k × v ) = v k ( k v ) v v = + v k v v k × v sin k × v sin k ×( k × v )(1 cos ) cos v k k ×( k × v ) k × v v rot v rot v rot v This rotation is correct since the vectors $\mathbf v_⊥$ and $\mathbf k ×\mathbf v$ have the same length, and $\mathbf k ×\mathbf v$ is $\mathbf v_⊥$ rotated anticlockwise through 90° about $\mathbf k$. An appropriate scaling of $\mathbf v_⊥$ and $\mathbf k×\mathbf v$ using the trigonometric functions sine and cosine gives the rotated perpendicular component. The form of the rotated component is similar to the radial vector in 2D planar polar coordinates $(r, \theta)$ in the Cartesian basis $$\mathbf{r} = r \mathbf{e}_x \cos\theta+ r \mathbf{e}_y \sin\theta$$ where $\mathbf e_{x}, \mathbf e_{y}$ are unit vectors in their indicated directions. Now the full rotated vector is $$\mathbf{v}_{\mathrm{rot}} = \mathbf{v}_{\parallel\mathrm{rot}} + \mathbf{v}_{\perp\mathrm{rot}} $$ By substituting the definitions of $\mathbf v_{∥\rm rot}$ and $\mathbf v_{⊥\rm rot}$ in the equation results in \begin{align*} \mathbf{v}_{\mathrm{rot}} & = \mathbf{v}_\parallel + \mathbf{v}_\perp\cos\theta + \mathbf{k}\times\mathbf{v} \sin\theta\\ & = \mathbf{v}_\parallel + \left(\mathbf{v} - \mathbf{v}_\parallel\right)\cos\theta + \mathbf{k}\times\mathbf{v}\sin\theta \\ & = \mathbf{v} \cos\theta+ (1 - \cos\theta)\mathbf{v}_\parallel + \mathbf{k}\times\mathbf{v} \sin\theta\\ & = \mathbf{v}\cos\theta + (1 - \cos\theta)(\mathbf{k} \cdot \mathbf{v})\mathbf{k} + \mathbf{k}\times\mathbf{v}\sin\theta \end{align*}

Matrix notation

$\mathbf v$ and $\mathbf k ×\mathbf v$ as column matrices, the cross product can be expressed as a matrix product $$\begin{bmatrix} (\mathbf{k}\times\mathbf{v})_x \\ (\mathbf{k}\times\mathbf{v})_y \\ (\mathbf{k}\times\mathbf{v})_z \end{bmatrix} = \begin{bmatrix} k_y v_z - k_z v_y \\ k_z v_x - k_x v_z \\ k_x v_y - k_y v_x \end{bmatrix} = \begin{bmatrix} 0 & -k_z & k_y \\ k_z & 0 & -k_x \\ -k_y & k_x & 0 \end{bmatrix} \begin{bmatrix} v_x \\ v_y \\ v_z \end{bmatrix} $$ Letting $\mathbf K$ denote the cross-product matrix for the unit vector $\mathbf k$, $$\mathbf{K}= \left[\begin{array}{ccc} 0 & -k_z & k_y \\ k_z & 0 & -k_x \\ -k_y & k_x & 0 \end{array}\right]\,, $$ that is to say, $$\mathbf{K}\mathbf{v} = \mathbf{k}\times\mathbf{v} $$ for any vector $\mathbf v$. (In fact, $\mathbf K$ is the unique matrix with this property. It has eigenvalues 0 and $±i$). It follows that iterating the cross product is equivalent to multiplying by the cross product matrix on the left; specifically: $$\mathbf{K}(\mathbf{K}\mathbf{v}) = \mathbf{K}^2\mathbf{v} = \mathbf{k}\times(\mathbf{k}\times\mathbf{v}) \,. $$ The previous rotation formula in matrix language is therefore \begin{align*} \mathbf{v}_\mathrm{rot} & = \mathbf{v} \cos\theta + (\mathbf{k} \times \mathbf{v})\sin\theta + \mathbf{k} ~(\mathbf{k} \cdot \mathbf{v}) (1 - \cos\theta) \\ & = \mathbf{v} \cos\theta + (\mathbf{k} \times \mathbf{v})\sin\theta + (\mathbf{v} - \mathbf{v}_{\perp}) (1 - \cos\theta) \\ & = \mathbf{v} \cos\theta + (\mathbf{k} \times \mathbf{v})\sin\theta + (\mathbf{v} + \mathbf{k}\times(\mathbf{k}\times\mathbf{v}))(1 - \cos\theta) \\ & = \mathbf{v} \cos\theta + (\mathbf{k} \times \mathbf{v})\sin\theta + (\mathbf{v} + \mathbf{K}(\mathbf{K}\mathbf{v})) (1 - \cos\theta) \\ & = \mathbf{v} (\cos\theta + 1 - \cos\theta) + (\mathbf{k} \times \mathbf{v})\sin\theta + \mathbf{K}(\mathbf{K}\mathbf{v}) (1 - \cos\theta) \end{align*} So we have: $$\mathbf{v}_{\mathrm{rot}} = \mathbf{v} + (\sin\theta) \mathbf{K}\mathbf{v} + (1 - \cos\theta)\mathbf{K}^2\mathbf{v} \,,\quad \|\mathbf{K}\|_2 = 1$$ Note the coefficient of the leading term is now 1, in this notation: see the Lie-Group discussion below. Factorizing the $\mathbf v$ allows the compact expression $$\mathbf{v}_\mathrm{rot} = \mathbf{R}\mathbf{v}$$ where
$$\mathbf{R} = \mathbf{I} + (\sin\theta) \mathbf{K} + (1-\cos\theta)\mathbf{K}^2$$
is the rotation matrix through an angle $\theta$ counterclockwise about the axis $\mathbf k$, and $\mathbf I$ the 3×3 identity matrix. This matrix $\mathbf R$ is an element of the rotation group $\rm SO(3)$ of $\mathbb R^3$, and $\mathbf K$ is an element of the Lie algebra $\mathfrak{so}(3)$ generating that Lie group (note that $\mathbf K$ is skew-symmetric, which characterizes $\mathfrak{so}(3)$). In terms of the matrix exponential, $$\mathbf{R} = \exp (\theta\mathbf{K})$$ To see that the last identity holds, one notes that $$\mathbf{R}(\theta) \mathbf{R}(\phi) = \mathbf{R} (\theta+\phi), \quad \mathbf{R}(0) = \mathbf{I} $$ characteristic of a one-parameter subgroup, i.e. exponential, and that the formulas match for infinitesimal $\theta$. For an alternative derivation based on this exponential relationship, see exponential map from $\mathfrak{so}(3)$ to $\mathrm{SO}(3)$. For the inverse mapping, see log map from $\rm SO(3)$ to $\mathfrak{so}(3)$. The Hodge dual of the rotation $\mathbf{R}$ is just $\mathbf{R}^* = -\sin(\theta)\mathbf{k}$ which enables the extraction of both the axis of rotation and the sine of the angle of the rotation from the rotation matrix itself, with the usual ambiguity, $$\begin{align} \sin(\theta) &= \sigma \left|\mathbf{R}^*\right| \\[3pt] \mathbf{k} &= -\frac{\sigma\mathbf{R}^*}{\left|\mathbf{R}^*\right|} \end{align}$$ where $\sigma = \pm 1$. The above simple expression results from the fact that the Hodge duals of $\mathbf{I}$ and $\mathbf{K}^2$ are zero, and $\mathbf{K}^* = -\mathbf{k}$. When applying the Rodrigues' formula, however, the usual ambiguity could be removed with an extended form of the formula.
Last edited by hbghlyj 2023-5-16 11:31

458

Threads

951

Posts

9832

Credits

Credits
9832

Show all posts

青青子衿 Posted 2023-5-16 14:10
LL = {{1}, {1}, {1}}.{Cross[{x1, y1, z1}, {x2, y2, z2}]}*
   IdentityMatrix[3];
P = {{0, 1, 0}, {0, 0, 1}, {1, 0, 0}};
Q = Transpose[P];
R = IdentityMatrix[3] +
    1/(Norm[{x1, y1, z1}]*Norm[{x2, y2, z2}]) (P.LL.P - Q.LL.Q) +
    1/((Norm[{x1, y1, z1}]*
          Norm[{x2, y2, z2}]) (Norm[{x1, y1, z1}]*Norm[{x2, y2, z2}] +
           Dot[{x1, y1, z1}, {x2, y2, z2}])) (P.LL.P -
        Q.LL.Q).(P.LL.P - Q.LL.Q) /. {x1 -> 2, y1 -> 2, z1 -> -1,
    x2 -> 2, y2 -> -1, z2 -> 2};
R.{{x1}, {y1}, {z1}} - {{x2}, {y2}, {z2}} /. {x1 -> 2, y1 -> 2,
  z1 -> -1, x2 -> 2, y2 -> -1, z2 -> 2}

Mobile version|Discuz Math Forum

2025-5-31 10:32 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit