Web - Amazon

We provide Linux to the World


We support WINRAR [What is this] - [Download .exe file(s) for Windows]

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
SITEMAP
Audiobooks by Valerio Di Stefano: Single Download - Complete Download [TAR] [WIM] [ZIP] [RAR] - Alphabetical Download  [TAR] [WIM] [ZIP] [RAR] - Download Instructions

Make a donation: IBAN: IT36M0708677020000000008016 - BIC/SWIFT:  ICRAITRRU60 - VALERIO DI STEFANO or
Privacy Policy Cookie Policy Terms and Conditions
Quaternions and spatial rotation - Wikipedia, the free encyclopedia

Quaternions and spatial rotation

From Wikipedia, the free encyclopedia

The main article on quaternions describes the history and purely mathematical properties of the algebra of quaternions. The focus of this article is the practical application of these mathematical ideas in engineered physical systems.

The algebra of quaternions is a useful mathematical tool for formulating the composition of arbitrary spatial rotations and establishing the correctness of algorithms founded upon such compositions. These methods find broad application in computer generated graphics, robotics, global navigation, and the spatial orientation of instruments. (citation: Quaternions and rotation Sequences: a Primer with Applications to Orbits, Aerospace, and Virtual Reality, Kuipers, Jack B., Princeton University Press copyright 1999)

Familiarity with the definition of a quaternion and the associated arithmetical rudiments is assumed. These may be gleaned from a cursory examination of a few paragraphs in the article on quaternions.

Contents

[edit] Introduction

The 1909 edition of Webster's unabridged dictionary (citation: Webster's New International Dictionary, G. & C. Merriam Co. copyright 1909, pp1752) defines a quaternion as

5. Math. The quotient of two vectors ... Such is the view of the inventor, Sir Wm. Rowan Hamilton, and his disciple, Prof. P. G. Tait; but authorities are not yet quite agreed as to what a quaternion is or ought to be.

This definition together with the excised "..." is technically correct if the definition of "vector" is restricted to its three dimensional conception, but the waggish remark serves to anecdotally illustrate the aura of arcane and possibly irrational esotericism that encumbered the mathematical discipline in its early days. To some degree, the disrepute of those early perceptions persists today.

The purpose of this introduction is to demystify the quaternions by demonstrating that the underlying concepts are pervasive in the everyday experience of ordinary people. This will establish a solid intuitive foundation upon which the mathematical and algorithmic content of the remainder of the article may be constructed. In fact, when approached from a geometric perspective, the quaternion algebra is as easy to understand, utilize, and apply as the algebra of complex numbers.

[edit] Non-commutativity

When considered as a purely numerical algebraic system, the non-commutativity of quaternion multiplication strikes many initiates as capricious and counter-intuitive. The following simple exercise demonstrates otherwise.

Consider an asymmetrical object, for example, a book. Set it on a table so that the spine is to the left (facing negative X) and the front cover is visible (positive Z) with the title readable. Define the three orthonormal spatial axes as follows: positive z extends up from the table, and x and y oriented as usual, i.e. x extending from left to right, and y extending away from the viewer.

The application of two rotation operators to the book will demonstrate non-commutativity. First, rotate the book 90 degrees clockwise about the z axis, so that the spine is facing away (towards positive Y). Next rotate the book 180 degrees clockwise about the y axis, so that now the front cover faces down and the spine faces forward (towards negative Y).

The application of these same two rotation operators in reverse order, first yields the book in a position with the cover facing down (negative Z) and spine remaining facing left (negative X).

After applying the z rotation, the book rests in its final position with the cover facing down (negative Z) and the spine facing away (positive Y), demonstrating zy\neyz. In fact, the composition zy represents a single rotation of 180 degrees about the [-1 1 0] axis, and yz represents a single rotation of 180 degrees about the [1 1 0] axis.

In general, the composition of two different rotations about two distinct spatial axes will not commute. This is a truth that all of us subconsciously understand and apply every day. Quaternion algebra is simply a mathematical formulation of this truth.

[edit] Double covering

This second exercise demonstrates the property of a quaternion rotation operator that for each complete turn of the angular parameter, the image of the object to which the operator is applied turns twice.

In a sitting position extend the forearm from the waist with the palm open and up. Place a small object, such as a coin on the open palm, so that only gravity holds the coin in the palm. When the following exercise is complete, the palm (and coin) will have rotated 720 degrees or two turns, without dropping or squeezing the coin.

Define the three orthonormal spatial axes as follows: positive z extends up from the palm, and x and y oriented as usual, i.e. x extending from left to right through the shoulder sockets, and y extending away from the viewer.

Four pivot axes are of interest. The first is attached to the shoulder socket and aligned with the y axis. The second is attached to the elbow, and is aligned orthogonal to the upper arm and forearm. The third is aligned with the forearm, and the fourth is aligned orthogonal to this at the wrist in the plane of the palm.

First rotate the palm clockwise 180 degrees (counter-clockwise for left handed people). The various pivot axes will turn in synchrony in order to maintain the palm facing up, so that the palm comes to rest over the shoulder with the fingers pointing back. Next rotate the palm another 180 degrees clockwise, with the gimbals modulating so that the palm comes to rest with the fingers pointing forward and the upper arm extended upward with the forearm angled up.

Similarly, continue with another 180 degrees, so that the palm lingers with the fingers pointing back under the armpit with the elbow akimbo up and back with the upper arm extended horizontally. Finally rotate the last 180 degrees, bringing the arm to rest in the original position. It is much easier to do this than to describe it.

The movement is a composition of continuously applied incremental rotations about the four pivot axes, which notably, do not have fixed alignment with the orthonormal coordinate system. Each pivot traverses, in various combinations, 180 degrees clockwise, and 180 degrees counterclockwise, for a total of 360 degrees. For example, the wrist first flexes 90 degrees back, then 180 degrees forward, and finally 90 degrees back. In contrast, the elbow closes 90 degrees, then opens 90 degrees, and then repeats the sequence. The palm (and coin), which is the image of the operation, traverses 720 degrees clockwise about the z coordinate axis.

Quaternion algebra provides an intuitive means for modelling these operations using the naturally defined variably oriented axes established by the physical circumstances. Any other method requires grappling with a tangle of trigonometric identities which convert the motions to the unnatural orthonormal reference frame.

[edit] Chirality

If a person endeavors to rotate the left hand so that it coincides with the right hand - palms facing in the same direction, thumbs and corresponding fingers aligned, the impossibility of the effort will soon become clear. The left and right hands are mirror images of each other, and a reflection is required to bring them into coincidence. Everyone understands instinctively that this is not possible in three dimensions. The generalization of this concept of "handedness" is known as chirality.

Chiral properties depend on the dimension of the space objects are constrained to occupy. For example consider the letter "L" located at the origin in the x-y plane. It is not possible to form the reflection of the letter across the y axis by using rotations constrained to lie entirely in the x-y plane. It is, however, possible to rotate the letter about the y axis, out of the plane 180 degrees, so that the image returns to lie in the plane.

A two dimensional reflection can be seen to be the two dimensional projection of a 180 degree three dimensional rotation. From the perspective of a three dimensional observer, the image is not a reflection, since it is possible for such an observer to go around behind the plane, where looking at the back side of the image, the "reflected" "L" appears normal. A three dimensional chiral object must have three asymmetries.

So for example, if it were possible to rotate the left hand 180 degrees through the fourth dimension and back into three dimensional space, the left hand could be made to coincide with the right hand simply by applying a rotation. Of course from the perspective of a four dimensional observer, the image of the hand is not a reflection, for the observer can go around "behind" the three space, where looking at the "back" side, the hand looks normal. Naturally it is difficult to visualize this, except by analogy. A four dimensional chiral object must have four dimensions of asymmetry. This process can be extrapolated ad infinitum, but for the purposes of this article, four dimensions suffice.

It is worth noticing that if the aforementioned left hand is biological, it is not possible to bring it into coincidence with the right hand at the molecular level by rotating it through the fourth dimension. The reason is that all of the right handed DNA will be converted to left handed DNA by the rotation operation. To see this clearly, consider constructing the two-dimensional "L" out of right handed L-shaped tiles, nested together, say four along the short leg, and six along the long leg. Once reflected in the y axis, each tile will be left handed, and so will not coincide with a left handed "L" constructed from right handed tiles.

Image:Quat_Chirality.jpg

Chirality gives a four dimensional insight into the nature of double covering, demonstrates the fundamental importance of the simple concept of a reflection, and illustrates that three dimensional rotations are just a subset of fully general four dimensional rotations. The algebra of quaternions is four dimensional because it models four dimensional rotation operations, which necessarily include all three dimensional operations as a proper subset.

[edit] Definitions

In keeping with the empirical perspective of this article the presentation focuses on the practical needs of an implementor of a technological subsystem embodying quaternion algebra. Typically, such subsystems are software systems executing on a digital computer. In contrast to a pure mathematician, a practitioner is always concerned with the low level detail of a representation, for these details ultimately determine whether a system works correctly or fails. Wherever possible, the details will be hidden by an abstraction which approaches a pre-existing mathematical ideal, but due to the finite nature of computing, such abstractions necessarily fall short of pure mathematics.

In keeping with this approach, the terminology and notation is chosen to reflect modern mathematical use wherever possible, and deviates to reflect modern technological use in aspects where details are important or known to be troublesome. These sections define the concepts, terminology, and notation useful in this presentation.

[edit] Concepts

It is important to clearly define the distinct mathematical concepts in order to separate their utilization and incompatibilities when implementing a geometrical algorithm. The resulting taxonomy can be implemented with the class definition facilities available in more modern programming languages. In practice, an amalgam of different, incompatible concepts is necessary in a given application, and the transition between them is accomplished by ad hoc methods. Careful definition minimizes the potential for operational error.

[edit] Euclidean space

Euclidean space is the set of absolute positions in n-dimensional space, typically represented by an n-tuple referred to an orthonormal basis. In three dimensions, it is a representation of the classical physical world we live in, and in four dimensions, it can represent various abstract extensions of that world, including the physicist's space-time, other non-Euclidean geometries, or the four dimensional analogue of our world.

Addition of two positions is not well defined in Euclidean space. This can be seen by considering that an n-tuple representation of an object depends upon the choices of origin and basis orientation, which are arbitrary. Therefore, the sum of two positions in one representation produces an absolute position, which will not equal the absolute position implied by the sum produced in another representation. This problem arises when simply translating the origin some small distance from the original representation. (illustrative figure here) The positions are unique absolute physical positions, whereas the n-tuple is merely a symbolic abstraction.

The addition of a difference of two positions is, however, well defined, yielding a unique absolute position independent of coordinate representation. Such a difference is traditionally called a vector in contradistinction to a position. It has a fixed length, which is called the distance between two positions. This length is easily computed using the familiar Euclidean metric. The Euclidean metric is invariant under rigid transformations of the space, i.e. under rotations and translations.

Any two positions [a] and [b] define two vectors [v] = [a - b], and -[v] = [b - a]. While the specific n-tuple defining [v] varies with coordinate representation, the addition of [v] to a position referred to the same basis produces an n-tuple referred to that basis, representative of an absolute position which is independent of the particular basis chosen for performing the computations.

In practice, Euclidean space is the world or rendering space of a computer graphics system, or the space in which servos and sensors operate in a control system. It is the space in which object definitions are instantiated by placing them at specific positions in the world space. It is the target space of a series of computations.

[edit] Affine space

Affine space is the set of differentials on Euclidean space. Since all of the elements are differences, addition of two elements produces another difference, so addition is well defined, independent of the coordinate system chosen for the underlying Euclidean space. Affine space is commonly called a vector space, and admits scalar multiplication as well as the Euclidean metric, although these are optional.

In practice, affine space is the space in which objects are defined, referred to a basis which varies from object to object, and which is typically chosen for its convenience for defining the object at hand.

[edit] Projective space

Projective space is one possible non-Euclidean affine space. As the name implies, projective space is a set well suited to defining and manipulating projective transformations, more generally called Möbius transformations. These include, in particular, the all important perspective transformations of computer graphics and imaging systems. The Euclidean metric is not preserved by möbius transformations, but the cross-ratio, which measures the relative proportion of a differential to two other differentials, is invariant.

There are several ways to represent projective space, but perhaps the most common is the homogeneous representation. This method establishes an equivalence class among points on a line through the origin in a space with dimension one greater than the target space. Thus, for example, a point in three dimensional projective space is represented by the quadruple [w x y z] with [1 x/w y/w z/w] considered to be the canonical representation. Two points are equivalent if and only if their canonical representations are equal. More detailed descriptions of projective geometries may be found in (citation: Projective Geometry, H.S.M. Coxeter, Blaisdell Publishing Company, copyright 1964) (citation: The Real Projective Plane, H.S.M. Coxeter, Cambridge University Press, copyright 1955 & Springer-Verlag, copyright 1993) (citation: Geometry - A Comprehensive Course, Dan Pedoe, Cambridge University Press, copyright 1970)

A projective geometry is a dual space in which a one to one equivalence is established between points in the space and the set of n-1 dimensional subspaces. One consequence is that a projective space is not orientable. For example, in two dimensions, the projective space can be created from the Euclidean plane by adjoining to the Euclidean set a line at infinity, which is dual to the origin. Subsequently, it is not possible to say which "side" of a line a point is on, since it is always possible to go around through the line at infinity, and the absence of the Euclidean metric makes the notion of distance meaningless. A practical consequence of non-orientability in a graphics system is that objects behind the viewpoint can wrap around through infinity and show up as background clutter in a rendering. This problem is usually accommodated by including a rear clipping plane during rendering.

In practice, three dimensional projective space is the space of choice for performing the coordinate transformations necessary to instantiate a database of object descriptions in a world space. The Euclidean metric and orientability are usually implemented in various ad hoc ways - see for example (citation: Oriented Projective Geometry: a Framework for Geometric Computations, Jorge Stolfi, Academic Press, copyright 1991) (citation: Curves and Surfaces for Computer Aided Geometric Design: a Practical guide, Gerald E. Farin, Academic Press, copyright 1988).

[edit] Operator space

An operator space is a set of endomorphic mappings on an object space. The composition of two operators yields another mapping on the object space, so the composition is contained within the operator space.

For example, the set of 3x3 matrices is an operator space on three dimensional Euclidean space, and the set of 4x4 matrices is an operator space on three dimensional projective space. Composition can be matrix multiplication or addition. Application of the operator is achieved via matrix multiplication. If the object space is considered a row vector, the operator is right applicative, i.e. it is a postfix operator. If the object space is considered a column vector, the operator is left applicative, i.e. it is a prefix operator. In these two examples, the operator and object spaces are disjoint, and the only interface between the two is the definition of operator application.

This need not be the case. The quaternions form an operator space on 4-vectors. Composition can be quaternion multiplication or quaternion addition. Application, in the most general sense, is quaternion multiplication or addition, and may be right or left applicative. Most importantly, there is a one to one correspondence between each 4-vector and each quaternion operator, i.e. each 4-vector may be interpreted as an operator and vice versa. The identity between these two sets can lead to much confusion, so it is important to separate the definitions.

The set of 4-vectors is simply an affine vector space. The quaternions are a division algebra. In the parlance of computer programming, they are two different data types. The interface between the types includes the definitions of operator application, and a pair of explicit type conversion functions. Mixed expressions outside these limits will cause implicit type conversion errors during compilation in strongly typed programming languages and produce execution exceptions or incorrect operation in other languages.

The larger purpose of this article is to establish the equivalence of traditional matrix operator representations and the quaternion operator representation, together with conversion algorithms. In practice, a quaternion representation is more adaptable to creating intuitive user interfaces, while the matrix representation is more computationally efficient. User interface routines are therefore typically implemented with quaternions for code clarity and ease of modification, while execution engines are implemented with matrices for performance. Robust and correct conversion procedures are therefore necessary.

[This article is under reconstruction. The preceding text is essentially complete, except for minor editing, such as checking spelling, formatting, and link insertion. The following text still needs attention]

[edit] Terminology

[edit] Historical

Some of the historical terminology has its origin in the writings of Sir William Rowan Hamilton, the inventor of quaternions. Other terms simply illustrate the evolution of language in the diverse, sometimes incompatible, endeavors of a broad topical area such as mathematics. The only historical terms that are used in this article are norm and the usage of conjugate with origins in complex analysis.

Tensor 
Derived from the Latin tendere, tensum - to stretch the term tensor has a modern usage completely disjoint from its usage in early papers on quaternions, where it was synonymous with the magnitude of a quaternion. The 1909 Webster's defines the quaternion tensor

2. Geom. The ratio of the mere lengths of two vectors; - so called as merely stretching one vector into another. The tensor, denoted by Tq, of a quaternion w+ix+jy+kz is\sqrt{}(w2 + x2 + y2 + z2), the square root of its norm.

Versor 
Derived from the Latin vertere, versum - to turn the term versor may be encountered in early papers on quaternions and refers to what is now called a unit quaternion, i.e. a quaternion whose magnitude is unity. The term versor is now obsolete, and completely anachronistic.
Conjugate 
Used as a noun, the term refers to the counterpart of a given quaternion whose scalar component is identical to the given scalar component, and whose spatial component is the given spatial component negated. Used in this sense, a quaternion conjugate is analogous to the complex conjugate of complex number theory. The formation of a conjugate is the complementary operation of a reflection: a reflection negates a one dimensional subspace and fixes the remainder; in contrast, a conjugate fixes one dimension, and negates the remainder. Given [q], [q*] denotes the conjugate of [q].
Used as a verb, it may mean to form a quaternion conjugate, a meaning which has its origins in complex analysis. It may also mean to form [q*vq], or [pvq] where [p] and [q] are unit quaternions, and [v] is a 3-vector in the former case, and a 4-vector in the latter. This second meaning has its origins in group theory, and may be expressed "conjugate [v] by [q]". In order to avoid confusion, this article avoids this second usage and expresses the same idea by the phrase "apply [q] to [v]".
Norm 
The Oxford English Dictionary (citation: Oxford English Dictionary, Oxford University Press, copyright 1933, Vol. N, pp207) defines norm as

b. Algebra. (See quot.) 1866 Brande & Cox Dict. Sci., etc. II 228/2 the product a2 + b2 of a complex number a + b\sqrt{}( − 1) and its conjugate ab\sqrt{}( − 1) is called its norm.

Notice this definition reinforces the implicit definition in the citation under "tensor" above, and shows the usage in most modern works, which defines the norm as synonymous with magnitude, is a relatively recent change in terminology. Notably, John Conway, in his recent work (citation: On Quaternions and Octonions: their geometry, arithmetic, and symmetry, Conway, John H. & Smith, Derek A., A. K. Peters, copyright 2003) resurrects this older usage to good effect. This article conforms to this older usage in order to unambiguously distinguish between the concepts of norm and magnitude as well as to clarify the presentation of the generalized pythagorean theorem.
Scalar part 
The real number component of a quaternion.
Imaginary part 
Analogous to a complex number a+bi, a quaternion may be written as a+bu where [u] is a unit 3-vector. The set a+bu where [u] is fixed and a and b are arbitrary real numbers is isomorphic to the complex numbers. In particular , note that [u²]=-1. The quaternions therefore comprise infinitely many copies of the complex numbers, each defined by a vector [u] on the surface of the unit sphere in three dimensional space. As such, this article refers to the imaginary component as the spatial component, or a 3-vector.
Pure quaternion 
A quaternion whose scalar component is zero, i.e. is purely imaginary. In this article, such an entity is simply called a 3-vector.

[edit] Modern

n-tuple 
a linear array of n real numbers [a0 a1 ... a(n-1)] with a(i) typically represented as a floating point number.
orthonormal basis 
n mutually orthogonal unit vectors which span an n-dimensional space.
vector 
An n-tuple interpreted as the coordinates of a spatial position referred to an orthonormal basis.
3-vector 
A three dimensional spatial position referred to the orthonormal basis
  • i=[0 1 0 0]
  • j=[0 0 1 0]
  • k=[0 0 0 1]
4-vector 
A four dimensional spatial position referred to the 3-vector's basis augmented by the unit vector
  • h=[1 0 0 0]
quaternion 
a 4-vector resulting from the polynomial product of two 3-vectors where [i²]=[j²]=[k²]=[ijk]=-1 and [h²]=[h], i.e. [h]=1. A quaternion may be thought of as the sum of a scalar (the [h] coordinate) and a 3-vector.

[edit] Notation

The notation used herein is an amalgam of various mathematical notations in common use, and notations which have proven convenient in programming systems. The decision to use a particular element in the notation was governed by the following considerations in decreasing priority.

  • Established precedent in existing mathematical discourse, leading to readability
  • Unambiguous representation of concepts, thereby avoiding confusion
  • Harmonious cohesion with other elements, allowing concise expression
  • Practical specification of detail, providing utility
  • Linear denotation, for ease of editing

Apart from the specific amalgam, there is one feature that distinguishes the notation from other mathematical notations: the notation forms a context free grammar. Expressions in the notation may therefore easily be interpreted by machine, or compiled into executable code. Moreover, the notation may easily be adapted to any existing programming language, by running it through a preprocessor which converts the notation into the appropriate, but less readable, series of library function calls.

[edit] Elements

There are two essential attributes of any data object: the actual representation of the object, and the address where it is stored. The former may be either an atomic element, specific to a particular architecture, e.g. a byte of memory, or a linear array of such atoms, i.e. an n-tuple. The specific meaning or formatting associated with these essentials is an interpretation layered on top. What follows is an explication of semantics associated with the typographical representation of these essentials.

Scalars
are denoted by italic text, e.g. a, b, c, s, etc. In keeping with mathematical notation and existing programming conventions of static and automatic allocation, the address of a scalar's storage location is implicit.
n-tuples
are typically dynamically allocated, and access to addresses (pointers) is important. The address of the storage location of an n-tuple is denoted by bold text, e.g. u, v, w, p, q, etc. The actual data value is denoted by [address], e.g. [v], [q], etc. This usage is an amalgam of the long standing textual denotation of matrices and vectors found in mathematical tracts, and the usage of a simlar notation for dereferencing addresses found in many assembly language syntaxes. It also reflects the notation for array subscripting used in many higher level languages. The symbols [] may be thought of as a dereferencing operator, more fully described below.
Rectangular arrays
are n-tuples with n = (l)(m) and an interpretation imposed which views successive l-tuples as the rows of an l x m array. These arrays are denoted by bold capital text in the same fashion as n-tuples, e.g. [A], [B], [M], [N], etc.

[edit] Arithmetic operations

Multiplication
e.g. (a)(b), a[b] = [ab], [a][b] = [q].
Division
e.g. a/b, [a/b] = [q].
Addition
e.g. a+b, [a+b].
Subtraction
e.g. a-b, [a-b].

[edit] Bracket operations

[a]
the n-tuple pointed to by a, i.e. a dereferenced. [] has an operator precedence higher than all other operators, and like parentheses, may be nested, and is evaluated from innermost to outer most.
[a|
the n-tuple [a] interpreted as a row vector.
|b]
the n-tuple [b] interpreted as a column vector, i.e. the transpose of a row vector.
[a|b]
the inner product (i.e. matrix product) of the row vector [a| and the column vector |b], which reflects the notation used by physicist's in a way which is harmonious with the notation for the fundamental semantic here: finite n-tuples.
[A|
the rectangular array [A].
|A]
the transpose of the rectangular array [A]. The transposition operator is second in priority only to the dereferencing operator [].
[A|A]
the matrix product of the array [A| and its transpose |A].
[aʌb]
the wedge product of [a] and [b]. In three dimensions, this is the cross product, and reflects the notation used in many european mathematical tracts. It also follows the notation of Grassman algebras, where is four dimensions, [aʌbʌc] denotes a generalized cross product, i.e. a vector orthogonal to the parallelepiped defined by [a], [b], and [c], with magnitude equal to its volume.
[A B]
the matrix product of two compatible square arrays.
||a||
the norm of the n-tuple [a], i.e. the determinant of [a|a].
||A||
the determinant of [A|A]
|a|
the absolute value or magnitude of the n-tuple [a], i.e. the Euclidean metric equal to the square root of the norm.
|A|
the square root of ||A||, where [A] is an l x m array, i.e. the m-volume of the parallelepiped defined by the m rows of [A] in l dimensional space. (citation: k-Volume in Rn and the Generalized Pythagorean Theorem, Gerald J. Porter, American Mathematical Monthly vol. 103 #3 pp252, Mathematical Association of America, copyright March 1996)

[edit] Conventions

[edit] Example

A typical three dimensional projective space viewing transformation in left applicative form is denoted by:

[w] = [P:T:R:S|v]

Where P, T, R, S are perpective, translational, rotational, and scaling matrices respectively. The same operation denoted in right applicative form is:

[w] = [v|S:R:T:P]

That is, each matrix is transposed immediately following dereferencing, so the stored representation of each matrix is identical for both computations, and the resulting n-tuple is identical.

[edit] Reflections

Geometrically, a reflection in an n dimensional space is defined as the operator which fixes an (n-1) dimensional subspace and negates the corresponding mutually exclusive one dimensional subspace. This mutually exclusive one dimensional subspace is called the axis of reflection.

A reflection may be thought of as negating a single coordinate in a given representation, keeping all of the remaining coordinates unchanged. Since the choice of origin and basis are arbitrary, any arbitrary reflection may be so defined by a suitable choice of origin, and selecting one coordinate, say the first in the n-tuple, to represent the orthogonal projection of each vector onto the axis of reflection.

In two dimensions, the line orthogonal to the axis of reflection is called the mirror axis. In three dimensions, the plane orthogonal to the axis of reflection is called the mirror plane. In higher dimensions, the n-1 dimensional subspace orthogonal to the axis of reflection is called the mirror space. Vectors contained within the mirror space project onto the axis of reflection with zero magnitude. Such vectors are therefore unchanged by the reflection, and so it is clear why the (n-1) dimensional mirror space is called the fixed space of a reflection.

[edit] Analytic form of a reflection

Arbitrary vectors may be uniquely decomposed into the sum of a vector in the fixed space and a vector on the axis of reflection. The tool for computing such a decomposition is the inner product [a|v]. A reflection may therefore be concretely represented by a vector [a] along the axis of reflection. For computational convenience, [a] is assumed to have unit magnitude. There are two such unit vectors for each reflection, and for the purposes of computing a simple reflection, both are equivalent.

Define m(a,v) to be the reflection represented by [a] applied to an arbitrary vector [v]. Then

m(a,v) = [v-2[a|v]a]

That is, geometrically, subtracting from [v] the projection of [v] onto [a] moves [v] into the fixed space, and subtracting the same quantity again yields the mirror image of [v] on the other side of the mirror space.

[edit] Rotations

Geometrically, a rotation in an n dimensional space is defined as the operator which fixes an (n-2) dimensional subspace. The corresponding mutually exclusive two dimensional subspace is said to be rotated if distances within this plane are also preserved. This mutually exclusive two dimensional subspace is called the plane of rotation. The set of rotations of a space form a proper subset of the rigid motions of the space, which comprises all reflections, rotations, and translations.

In two dimensions the point orthogonal to the plane of rotation is called the center of rotation. In three dimensions the line orthogonal to the plane of rotation is called the axis of rotation. Logically, in higher dimensions the (n-2) dimensional subspace orthogonal to the plane of rotation would be called the subspace of rotation, but this terminology is apt to be confused with the plane of rotation, and will be avoided. It will suffice to refer to this orthogonal subspace as the fixed space of a rotation.

The progression of terminology is instructive, however, for it makes plain that the essence of a rotation, like a reflection, is the space which moves, and the fixed space is more ambiguous, depending on the dimension of the objects under consideration. Given human immersion in an ostensibly three dimensional Euclidean space, rotations are commonly thought of in terms of the axis of rotation, but this is a misdirection. Spatial rotations are fundamentally four dimensional quantities, which move a plane and fix an orthogonal plane. This truth is an implication of the Hurwitz-Frobenius Theorem, which states that the only division algebras over the real numbers are the real numbers, the complex numbers, the quaternions, and the octonians. There is no three dimensional division algebra, so even though we can not perceive a fixed fourth dimension in any physical rotation, it implicitly exists in the underlying mathematical abstractions.

[edit] Rotation: the composition of two reflections

[edit] Quaternion representation of a rotation

Rotation of a coordinate system by angle α about axis u is represented by quaternion q = cos(α/2) + u sin(α/2). Unit vector u has the same coordinates in both the original and rotated coordinate systems because the rotation is about u.

[edit] General rotations in four dimensional space

[edit] Canonical form

[This article is under reconstruction. The preceding text is in transition. The following text still embodies concepts not yet incorporated in the revision.]

[edit] Algebraic rules

Every quaternion z = a + bi + cj + dk can be viewed as a sum a + u of a real number a (called the “real part” of the quaternion) and a 3-vector u = (b, c, d) = bi + cj + dk in R3 (called the “imaginary part”).

Two such quaternions are added by adding the real parts and the imaginary parts separately:

(a + u) + (b + v) = (a + b) + (u + v)

The multiplication of quaternions translates into the following rule:

(a + u) (b + v) = (ab − <u, v>) + (av + bu + u × v)

Here, <u, v> denotes the scalar product and u × v the vector product of u and v.

This formula shows that two quaternions z and w commute, i.e., zw = wz, if and only if their imaginary parts are collinear vectors (because, in this case, the vector product of their imaginary parts will simply be equal to the zero vector).

[edit] Other properties

Consider the quaternions with modulus 1. They form a multiplicative group, acting on R3: for any such quaternion z = \cos\frac{\alpha}{2} + \sin\frac{\alpha}{2}\,\hat\mathbf{v}, the mapping f(x) = z x z* is a counterclockwise rotation through an angle \alpha\, about an axis v; −z is the same rotation. Composition of arbitrary rotations in R3 corresponds to the fairly simple operation of quaternion multiplication.

A pair of quaternions also allows for compact representations of rotations in 4D space; this is because the four-dimensional rotation group SO(4) may be written as a semi-direct product of the three-dimensional rotation group SO(3). The quaternions are, in turn, closely related to the double covering of SO(3) by SU(2). Also closely related are the Lorentz group SL(2,C) and the Poincaré group.

[edit] Quaternion rotation

It is well known that the vector product is related to rotation in space. The goal then is to find a formula which expresses rotation in 3D space using quaternion multiplication, similar to the formula for a rotation in 2D using complex multiplication,

f(w) = zw,

where

z = eαi

is used for rotation by an angle α.

The formula in 3D cannot be a simple multiplication with a quaternion, because rotating a vector should yield a vector. Multiplying a vector with a non-trivial quaternion yields a result with non-zero real part, and thus not a vector.

It turns out that we can cancel the real part if we multiply by a quaternion from one side and with its inverse from the other side. Let z = a + u be a non-zero quaternion, and consider the function

f(v) = z v z−1

where z−1 is the multiplicative inverse of z and v is a vector, considered as a quaternion with zero real part. The function f is known as conjugation by z. Note that the real part of f(v) is zero, because in general zw and wz have the same real part for any quaternions z and w, and so

\mathfrak{R}(z \ \mathbf{v} \ z^{-1}) = \mathfrak{R}(\mathbf{v} \ z^{-1} \ z) = \mathfrak{R}(\mathbf{v} \ 1) = 0

(note that this proof requires the associativity of quaternion multiplication). Furthermore, f is R-linear and we have f(v) = v if and only if v and the imaginary part u of z are collinear (because f(v) = v means v z = z v). Hence f is a rotation whose axis of rotation passes through the origin and is given by the vector u.

Note that conjugation with z is the equivalent to conjugation with rz for any real number r. We can thus restrict our attention to the quaternions of absolute value 1, the so-called unit quaternions. Note that even then z and −z represent the same rotation. (The absolute value |z| of the quaternion z = a + v is defined as the square root of a2 + ||v||2, which makes it multiplicative: |zw| = |z| |w|.) Inverting unit quaternions is especially easy: If |z| = 1, then z−1 = z* (the conjugate z* of the quaternion z = a + v is defined as z* = av) and this makes our rotation formula even easier.

It turns out that the angle of rotation α is also easy to read off if we are dealing with a unit quaternion z = a + v: we have

a = \cos \frac{\alpha}{2}.

To summarize, a counterclockwise rotation through an angle α about an axis v can be represented via conjugation by the unit quaternion z

z = \cos\frac{\alpha}{2} + \sin\frac{\alpha}{2}\,\hat\mathbf{v}

where \hat\mathbf{v} is the normalized vector

\hat\mathbf{v} = \frac{\mathbf{v}}{\|\mathbf{v}\|}.

The composition of two rotations corresponds to quaternion multiplication: if the rotation f is represented by conjugation with the quaternion z and the rotation g is represented by conjugation with w, then the composition f ∘ g is represented by conjugation with zw.

If one wishes to rotate about an axis that doesn’t pass through the origin, then one first translates the vectors into the origin, conjugates, and translates back.

The angle between two quaternions should not be confused with the angle of rotation involved in the rotation between the orientations corresponding to these quaternions: the former is half of the latter (or 180° minus half the latter). The angle between the axes of two rotations is again different.

For example the quaternion for the identity is ±1 and for a 180° rotation about the z-axis is ±k. The angle between the two quaternions is 90°. The angle between the axes of the two rotations is in this case undefined.

[edit] An example

Consider the rotation f around the axis u = i + j + k, with a rotation angle of 120°, or 3 radians.

\alpha = \frac{2 \pi}{3} = 120^\circ

The length of u is √3, the half angle is π3 (60°) with cosine ½ (cos 60° = 0.5) and sine √32 (sin 60° = 0.866). We are therefore dealing with a conjugation by the unit quaternion

z = \cos\frac{\alpha}{2} + \sin\frac{\alpha}{2}\,\hat\mathbf{u}
z = \cos 60^\circ + \sin 60^\circ\,\hat\mathbf{u}
z = \frac{1}{2} + \frac{\sqrt{3}}{2}\cdot\,\hat\mathbf{u}
z = \frac{1}{2} + \frac{\sqrt{3}}{2}\cdot \frac{(i+j+k)}{\sqrt{3}}
z = \frac{1 + i + j + k}{2}.

Concretely,

f(ai + bj + ck) = z (ai + bj + ck) z .

Note that z = 1/z, as z has unit modulus; here z = (1−ijk)/2. This can be simplified, using the ordinary rules for quaternion arithmetic, to

f(ai + bj + ck) = ci + aj + bk,

as expected: the rotation corresponds to keeping a cube held fixed at one point, and rotating it 120° about the long diagonal through the fixed point (observe how the three axes are permuted cyclically).

[edit] Quaternions versus other representations of rotations

The representation of a rotation as a quaternion (4 numbers) is more compact than the representation as an orthogonal matrix (9 numbers). Furthermore, for a given axis and angle, one can easily construct the corresponding quaternion, and conversely, for a given quaternion one can easily read off the axis and the angle. Both of these are much harder with matrices or Euler angles.

In computer games and other applications, one is often interested in “smooth rotations,” meaning that the scene should slowly rotate and not in a single step. This can be accomplished by choosing a curve such as the spherical linear interpolation in the quaternions, with one endpoint being the identity transformation 1 (or some other initial rotation) and the other being the intended final rotation. This is more problematic with other representations of rotations.

When composing several rotations on a computer, rounding errors necessarily accumulate. A quaternion that’s slightly off still represents a rotation after being normalised—a matrix that’s slightly off need not be orthogonal anymore and therefore is harder to convert back to a proper orthogonal matrix.

The orthogonal matrix corresponding to a rotation by the unit quaternion z = a + bi + cj + dk (with |z| = 1) is given by

\begin{pmatrix} a^2+b^2-c^2-d^2&2bc-2ad        &2ac+2bd        \\ 2ad+2bc        &a^2-b^2+c^2-d^2&2cd-2ab        \\ 2bd-2ac        &2ab+2cd        &a^2-b^2-c^2+d^2\\ \end{pmatrix}

(Compare the equivalent general formula for a 3 × 3 rotation matrix in terms of the axis and the angle.)

(Matrix is valid for opposite sense rotation (eg. right-handed rotation on a left-handed coordinate system). For same-sense rotation, negate the off-diagonal elements.)

See also: Charts on SO(3), Euler angles

[edit] Pairs of unit quaternions as rotations in 4D space

A pair of unit quaternions zl and zr can represent any rotation in 4D space. Given a four dimensional vector v, and pretending that it is a quaternion, we can rotate the vector v like this:

f(v)=z_lvz_r= \begin{pmatrix} a_l&-b_l&-c_l&-d_l\\ b_l&a_l&-d_l&c_l\\ c_l&d_l&a_l&-b_l\\ d_l&-c_l&b_l&a_l \end{pmatrix}\begin{pmatrix} a_r&-b_r&-c_r&-d_r\\ b_r&a_r&d_r&-c_r\\ c_r&-d_r&a_r&b_r\\ d_r&c_r&-b_r&a_r \end{pmatrix}\begin{pmatrix} w\\x\\y\\z \end{pmatrix}

It is straightforward to check that for each matrix M MT = I, that is, that each matrix (and hence both matrices together) represents a rotation. Note that since (zl v) zr = zl (v zr), the two matrices must commute. Therefore, there are two commuting subgroups of the set of four dimensional rotations. Arbitrary four dimensional rotations have 6 degrees of freedom, each matrix represents 3 of those 6 degrees of freedom.

Since an infinitesimal four-dimensional rotation can be represented by a pair of quaternions (as follows), all (non-infinitesimal) four-dimensional rotations can also be represented.

z_lvz_r=\begin{pmatrix} 1      &-dt_{ab}&-dt_{ac}&-dt_{ad}\\ dt_{ab}&1       &-dt_{bc}&-dt_{bd}\\ dt_{ac}& dt_{bc}&1       &-dt_{cd}\\ dt_{ad}& dt_{bd}& dt_{cd}&1 \end{pmatrix}\begin{pmatrix} w\\ x\\ y\\ z \end{pmatrix}

z_l= \left(1+{dt_{ab}+dt_{cd}\over 2}i+{dt_{ac}-dt_{bd}\over 2}j+{dt_{ad}+dt_{bc}\over 2}k\right)

z_r= \left(1+{dt_{ab}-dt_{cd}\over 2}i+{dt_{ac}+dt_{bd}\over 2}j+{dt_{ad}-dt_{bc}\over 2}k\right)

Quaternions are used in computer graphics and related fields because they allow for compact representations of rotations, or correspondingly, orientations, in 3D space:

[edit] See also

[edit] External links and resources

Our "Network":

Project Gutenberg
https://gutenberg.classicistranieri.com

Encyclopaedia Britannica 1911
https://encyclopaediabritannica.classicistranieri.com

Librivox Audiobooks
https://librivox.classicistranieri.com

Linux Distributions
https://old.classicistranieri.com

Magnatune (MP3 Music)
https://magnatune.classicistranieri.com

Static Wikipedia (June 2008)
https://wikipedia.classicistranieri.com

Static Wikipedia (March 2008)
https://wikipedia2007.classicistranieri.com/mar2008/

Static Wikipedia (2007)
https://wikipedia2007.classicistranieri.com

Static Wikipedia (2006)
https://wikipedia2006.classicistranieri.com

Liber Liber
https://liberliber.classicistranieri.com

ZIM Files for Kiwix
https://zim.classicistranieri.com


Other Websites:

Bach - Goldberg Variations
https://www.goldbergvariations.org

Lazarillo de Tormes
https://www.lazarillodetormes.org

Madame Bovary
https://www.madamebovary.org

Il Fu Mattia Pascal
https://www.mattiapascal.it

The Voice in the Desert
https://www.thevoiceinthedesert.org

Confessione d'un amore fascista
https://www.amorefascista.it

Malinverno
https://www.malinverno.org

Debito formativo
https://www.debitoformativo.it

Adina Spire
https://www.adinaspire.com