Nonsingular Efficient Modeling of Rotations in 3-space using three components

# Nonsingular Efficient Modeling of Rotations in 3-space using three components

Norman J. Goldstein Research & Development, MacDonald Dettwiler and Associates
13800 Commerce Parkway, Richmond, BC, Canada
###### Abstract.

This article introduces yet another representation of rotations in 3-space. The rotations form a 3-dimensional projective space, which fact has not been exploited in Computer Science. We use the four affine patches of this projective space to parametrize the rotations. This affine patch representation is more compact than quaternions (which require 4 components for calculations), encompasses the entire rotation group without singularities (unlike the Euler angles and rotation vector approaches), and requires only ratios of linear or quadratic polynomials for basic computations (unlike the Euler angles and rotation vector approaches which require transcendental functions).

As an example, we derive the differential equation for the integration of angular velocity using this affine patch representation of rotations. We remark that the complexity of this equation is the same as the corresponding quaternion equation, but has advantages over the quaternion approach e.g. renormalization to unit length is not required, and state space has no “dead” directions.

The work by which this paper came to fruition was partly funded by Defense Research and Development Canada (DRDC). I wish also to acknowledge the support of the R&D department at MacDonald Dettwiler and Associates, especially Vinay Kotamraju and Pezhman Firoozfam for comments and suggestions.

## 1. Introduction

This work was motivated by the need to have a practical and robust way to model rotations and projective spaces in the software that we write. These are applications in photogrammetry, remote sensing and simultaneous localization and mapping. Rotations are used in modeling the poses of the cameras, while the focal planes of the cameras are projective spaces. Although it is true that the imaging focal plane is contained in a single affine patch of , relevant vanishing points may lie on, or near, the line at infinity, so that the coordinates of the imaging affine patch are not appropriate for robustly describing and managing the vanishing points.

Traditionally, (unit) quaternions have been used to model rotations, as the quaternions have only 4 components – just one more parameter than the dimension of the space of rotations (see, for example [1, 2]). However, the extra component is bothersome, requiring extra storage, requiring extra work to manage the redundancy (renormalization to unit length), and likely affecting the convergence rate due to motion in the redundant length direction of the quaternion, when we are optimizing to find the best rotation for a particular problem.

Another approach to representing rotations is to use the three Eulerian angles, e.g.. However, this approach suffers from not being everywhere invertible, so is not a global solution to representing the rotations. Moreover, the transcendental transformation between Eulerian angles and rotation matrices is not ideal for software implementation. A similar situation is to be found with the rotation vector representation of a rotation. The on-line article  discusses this and other representations of rotations.

In the following sections, we review the standard coordinates on projective space, and then derive the differential equation for the integration of angular velocity using the projective space manifold structure (affine patches) on the rotation group. We will see that with this novel representation of the rotations, the differential equation has the same complexity as the corresponding quaternion differential equation, and has other desirable properties over the quaternion case.

## 2. Notation

All vector spaces and projective spaces are over the real numbers. For a point in n-dimensional projective space, , its homogeneous coordinates are denoted .

The traditional manifold structure on is given as

• The affine patch, , on is defined to be the set

 Vk={z=[z0,z1,…zn]:zk≠0}
• The coordinate chart for is

 xk:Vk⟶Rn

defined by the formula and throw away the 1 in the slot. This is seen to be a 1-1 map onto all of .

The following algorithm template illustrates how to use the manifold structure on to iteratively step along a sequence of points in projective n-space. For simplicity, we do not specify what it means to “iterate”, and we omit any stopping criteria.

###### Algorithm 2.1.

Iterate on Projective Space

1. An initial point, .

2. Let k be the index of the largest component, .

3. Represent in the affine patch. So, initially, all the coordinate components in this patch have magnitude at most 1.

4. Iterate to the next value of , in this patch.

5. If all coordinate components of have magnitude at most 2, go back to Step 3. Otherwise, proceed to Step 5.

6. Reconstruct the homogeneous coordinates, z, for the current point, and let k be the index of the the largest component .

7. Represent in the affine patch, and proceed to Step 3.

In Step 6, some book-keeping may be required to keep the overall environment of the algorithm consistent when switching patches. The choice of the value, 2, in Step 4 is somewhat arbitrary, but has worked well for us. The point is to monitor when a particular patch is no longer appropriate for the current value of , and then to switch to a good patch. If begins to converge, the switching of patches will cease.

This algorithm may be used when optimizing for a “best” value of z, or when incrementally solving a differential equation on projective space. In the next section, we write down explicitly the differential equation for integrating angular velocity, using the projective space manifold structure of the rotations.

## 3. Integrating Angular Velocity

We use the convention that the components of a quaternion, , are indexed as and , with being the scalar component, and denoting the 3-vector of the other (spatial) components.

The particular rotation matrix associated to q is

 R=I(2s2−1)+2vvt+2sMv

Where, is the identity 3x3 matrix, and is the usual 3x3 skew matrix defined by

 Mab=a×b

Explicitly,

 Ma=⎛⎜⎝0−a3a2a30−a1−a2a10⎞⎟⎠

Our jumping off point for analyzing angular velocity is the well-known () differential equation relating angular velocity, , and quaternions:

 (3.1) dqdt=12Hq=12(0  −ωtω  −Mω)q

This corresponds to the matrix equation

 dRdt=RMω .

It is Equation 3.1 that we wish to translate to the four affine patches of the rotations. To that end, we make explicit the components of the matrix in Equation 3.1.

 (3.2) H=⎛⎜ ⎜ ⎜ ⎜⎝0−ω1−ω2−ω3ω10ω3−ω2ω2−ω30ω1ω3ω2−ω10⎞⎟ ⎟ ⎟ ⎟⎠

We restrict attention to patch , , and let

 x=⎛⎜⎝x1x2x3⎞⎟⎠

be the 3 components parametrizing the rotations from this patch. The corresponding homogeneous coordinates, are obtained by forming the 4-vector with a 1 in the slot. So, is a non-unit quaternion, and we define a time-varying scale factor, by the equation

 ^x=αq

where q is now a unit quaternion. Consequently, Equation 3.1 is valid for q, and we may write

 d^xdt=dαdtq+α12Hq

which may be rewritten as

 (3.3) d^xdt=β^x+12H^x

where . To reduce this equation, further, we define the 3x4 matrix whose columns are the non-zero entries from the corresponding columns of H.

 (3.4) W=⎛⎜⎝ω1−ω1−ω2−ω3ω2−ω3ω3−ω2ω3ω2−ω1ω1⎞⎟⎠

We recall that the component of is identically 1, so its derivative is 0, and we conclude from the component of Equation 3.3 that

 0=β+12Hi^x

where is the row of . This can be rewritten as

 (3.5) β=12Wi⋅x

where is the column of W.

Extracting, now, the non- components of Equation 3.3, we obtain

 (3.6) dxdt = βx+12(Wi+H(i)x)

where is the 3x3 matrix obtained from by deleting the row and the column. By inspecting the four cases, we see that

 (3.7) H(i)=(−1)i+1MWi

Inserting Equations 3.5 and 3.7 into Equation 3.6, we obtain

 (3.8) dxdt = 12(Wi⋅x)x+12(Wi+(−1)i+1Wi×x) = 12[Wi+(Wi⋅x)x+(−1)i+1Wi×x]

Equation 3.8 is the 3-dimensional differential equation to integrate angular velocity using affine patches on the rotation group. The RHS contains 12 multiplications, excluding the scaling by 1/2. This is the same number of multiplications as in Equation 3.1, which is the corresponding quaternion differential equation.

### 3.1. Difference Equation

In practice, a difference equation is used to integrate angular velocity. This section shows how to obtain identical results to the quaternion solution, but by using the affine patch representation of the rotations. This has the advantage that explicit renormalization to unit length is not required, as it is inherent to the affine patch approach.

For a time step, of length , we wish to find the increment, , so that the two expressions, and , represent the same rotation i.e.

 (q+12HqΔt)¯i(q+12HqΔt)i=x+Δx

where denotes all the components except for the . Divide the top and bottom of the LHS by to obtain

 (3.9) x+12H¯i^xΔt1+12Hi^xΔt = x+ΔxΔtΔt

We recall from the derivation of Equation 3.8 that

 H¯i^x = Wi−(−1)iWi×x Hi^x = −Wi⋅x

so that Equation 3.9 simplifies to

 (3.10) ΔxΔt=Wi+(−1)i+1Wi×x+(Wi⋅x)x2−(Wi⋅x)Δt

It is interesting to note that this value of is the same as dividing by the scale factor .

## 4. Conclusions

We have applied elementary manifold theory to construct a global, efficient, singularity-free parametrization for the rotation group. We have derived differential and difference equations for integrating angular velocity using this novel representation of the rotations, and have shown that the complexity of using these equations is on a par with the corresponding quaternion equations. On a theoretical basis, however, the difference equation derived in this article is more sound, as there are no renormalizations to unit length required.

## References

•  C. E. Schultz, INS and GPS integration, MSc Thesis, Technical University of Denmark, Informatics and Mathematical Modeling (July 2006).
Last referenced October 29, 2009
•  Robert M. Rogers, Applied Mathematics in Integrated Navigation Systems, Edition. American Institute of Aeronautics and Astronautics (2003).
•  H. Goldstein, Classical Mechanics, Addison-Wesley, 1950.
•  Wikipedia, Rotation representation (mathematics)

#Euler_axis_and_angle_.28rotation_vector.29
Last referenced October 29, 2009
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters   