User:Rschwieb/GA Discussion/Comparison of methods: rotations

Description

edit

The subsequent sections first describe how a rotation is represented, then describe the procedures to solve basic tasks.

Basic rotation tasks:

Problem A: Given two vectors, find a rotation with plane of rotation containing the vectors that turns the first vector in the direction of the second.
Problem B: Given two sets of vectors, one of which is known to be obtained from the other through rotation, find a rotation that carries each vector in the first set to the corresponding vector in the second set (again keeping vectors orthogonal to all those involved unchanged).
Problem C: in 3-D, given a plane and a specified angle of rotation, find a rotor representing the rotation.
Problem D: (n-D analogues of C)

Rotation matrix procedure

edit
  • Problem A: The matrix b aT rotates a unit vector a to a unit vector b More complicated than this: matrix needs to be full rank. Without thinking very hard I suspect you may have to construct full before-and-after orthonomal basis sets A and B, then form B AT similar to Problem B, but there may be some short-cuts for the invariant subspace.
  • Problem B: see e.g Triad method for 3d case; in higher dimensions, one could use Gram-Schmidt to enforce orthogonalisation.

Euler angles? procedure

edit

GA procedure

edit

In a geometric algebra, a rotation is represented directly by an element of the algebra, called a rotor. A rotor R acts upon any element X of the algebra to produce its rotated equivalent X′:

 .

In 3 dimensions, this is exactly the quaternion method. (Found at Euvision Technologies: “Fontijne’s Formula” (apparently derived from GA): if 3D vector p rotates to p’, and q to q’, the quaternion of the rotation is [(q’+q)·(p’−p), (q’−q)×(p’−p)]. — Quondum 20:34, 6 February 2012 (UTC))

It is customary (but not necessary) to normalize R, so that RR~ = 1, i.e. R−1 = R~. R is always an even multivector. Here the notation A~ (alternately A) denotes the reversion of A.

Solution of Problems A and B in n-D (in 3-D this is no different)

Given two vectors a and b with a2 = b2 = ±1, the rotation that rotates a into b and keeps their orthogonal complement unchanged is:

 

The solution has been normalized. The distinction of sign is topologically significant. The case of (a + b)2 = 0 corresponds to no solution.

This rotation is associated with a plane of rotation given by ba. If b = −a, this is not sufficient to define a plane; there are many planes that could achieve such a rotation, but such rotations will also cause some vectors orthogonal to a and b to be transformed.
Example solution of Problem B

Given two sets of k vectors {ei} and {fi} related by a rotation, find a rotor R that rotates the one into the other (so that fi = ReiR−1), leaving all orthogonal vectors unchanged. Doran and Lazenby give the normalized solution for where the vectors form a 3-D basis in Euclidean space:

 ,

where {ek} is the dual basis to {ek}. The case of fkek = −1 requires special care.

A solution for n-D and n independent vectors related by a rotation (not verified):

 
Example 3

Given a plane and an angle of rotation in n-D, give the bivector describing the rotation and how R is related to it.

Given two vectors a and b spanning the plane and with the magnitude giving angle of rotation of θ in the direction from a to b, the bivector describing the plane and angle of rotation (picture a unit vector sweeping out a pizza slice) is

 

and the rotor is

 .

This can be easily generalized to independent angles with respect orthogonal planes of rotation in 4-D and above: just add the bivectors.

Example 4

Smooth rotation: expression of the SLERP in GA.

Quaternion procedure

edit
Example "baby" solution in quaternions

Problem: Demonstrate how to rotate the vector [0,1,1] 90 degrees about the y-axis to lie over [1,1,0] using a quaternion.

I am inclined to think the problem through in 3D GA, and apply the following mapping (treating quaternions (underlined) as being the even subalgebra of the GA), with the correspondence i = −e2e3, j = −e3e1, k = −e1e2; also I = e1e2e3:
MAPPING : QUATERNION ↔ G3,0
identity : quaternion scalar ↔ scalar [a = a]
dual : quaternion vector ↔ vector [a = −aI, a = aI]
identity : quaternion pseudovector ↔ bivector [a = a]
identity : quaternion rotor ↔ even grade versor (i.e. proper rotor) [R = R]
dual : quaternion reflection ↔ odd grade versor (i.e. improper rotor)
dual : quaternion pseudoscalar ↔ pseudoscalar
In GA, the rotor for the rotation (rotating   into   the short way around the y-axis; for the long way negate the rotor) is
 
 
 
So working purely with quaternions,
 
 
Checking, we find
 
as expected.
Beware the normal convention with quaternions is not the GA-centric approach I have used, though I have deliberately chosen the dual mapping for vectors to have matching signs, so it may be directly equivalent. Note that I have used the GA vectors (not underlined) rather than the corresponding quaternion vectors to calculate the rotor, though finding the expression for   from the quaternions   etc. will be simple enough. Feel free to trim this down to a concise version. Also, no guarantees that this is correct. — Quondum 21:29, 28 April 2012 (UTC)