Re: Questions regarding quaternions



On Feb 28, 11:33 am, "Zerex71" <Zere...@xxxxxxx> wrote:
Greetings,

I am implementing software that is going to make heavy use of
quaternions. I have found a plethora of information online but I
still have some questions that I would like to get some answers to:

1. In all of my reading, I understand that any method of mathematical
rotation (matrix multiplication, quaternions, etc.) can perform two
different tasks:

a. Take an object (e.g. vector) and rotate it in space to a new
desired orientation
b. Take a frame of reference (or measurements therein) and convert it
to another frame of reference (or measurements referenced that second
frame) without rotating it


The name for b is "translation". A translation is just changing the
origin of your coordinate system, without changes to the orientation
of the axes. A rotation changes the orientation of the axes, without
changing the origin (the origin is "fixed" by a rotation).

The change in coordinates that you are interested in is then a
combination of a rotation and a translation. There are two "usual"
ways of performing this:

(1) First apply a translation; then apply a rotation.
(2) First apply a rotation; then apply a translation.

A translation is applied by adding (or subtracting) a vector to every
point in the first space to find the corresponding point in the second
space. So if p is a point in the first space, we find p' = p + v for
some vector v.

A rotation can be applied by the quaternion operation you cite: if p
is a point in the first space, then we find p' = qpq^-1.

So the above 2 ways of transforming the space can be expressed as
follows:

(1) p' = q(p + v)q^-1 = qpq^-1 + qvq^-1
(2) p' = qpq^-1 + w = q(p + q^-1wq)q^-1

where I have extended the formulas a bit as allowed by distributivity
of multiplication.

Note that if w = qvq^-1, then the two formulas above give the same
result for all points p: mathematically, a translation followed by a
rotation is the same as a rotation followed by a (different)
translation.

To visualize this, imagine the axes of the original space XYZ as first
being "slid" until the origin is at the other set of axes X'Y'Z'.
Next, you rotate XYZ until the X axis correspond to the X' axis, and
the Y axis corresponds to the Y' axis (note that this will naturally
force the Z axis to correspond to the Z' axis). That is the
transformation described by (1).

Alternatively we could start by rotating the XYZ axis until the X axis
is parallel to the X' axis and the Y axis is parallel to the Y' axis
(note that this will naturally force the Z axis to be parallel to the
Z' axis). Now slide the (rotated) XYZ until its origin coincides with
the X'Y'Z' origin. That is the transformation described by (2).

I would like to get some clarification and explanation in my thinking
because it will really help me. When I think of situation a., I think
of an actual, physical rotation of a body (for example, if I pitch the
nose of a rocket up or down about its own inertial frame of reference,
sometimes called LVLH). When I think of situation b., I am not
physically rotating an object, but I want to take its angular
references in one coordinate frame of reference and calculate them
relative to another frame of reference (for example, if a vehicle is
pitched over so many degrees relative to some invisible inertial frame
of reference, but relative to another frame, has an entirely different
value for pitch). My question then is, Can both be done using
quaternions?

2. Let's say I have an orientation of a rocket on a launch pad,
perfectly vertical, tail facing due south, on a locally flat stretch
of land. Can I take a vector representing this situation and convert
it to a quaternion? Can I take the local launch pad xyz frame of
reference and convert it to a quaternion?

2. In looking at the p' = qpq^-1 quaternion transformation, that seems
to address situation a. above but not b. True or false?

3. When doing the p' = qpq^-1 quaternion transformation, you have a
vector and a quaternion. But where do I get the quaternion from? The
vector (or body under consideration) I obviously would have, but how
would I determine the quaternion?


See:

http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

to see how to form a quaternion which is a rotation around a vector v
through an angle theta.

4. When doing the p' = qpq^-1 quaternion transformation, is q (and
likewise, its inverse) a normalized quaternion? One of the
presentations I read seemed to indicate that q must be a unit
quaternion.


Suppose r is a real number. Then (r*q)^-1 = r^-1*q^-1; and so

(r*q)p(r*q)^-1 = r*r^-1*qpq^-1 = qpq^-1

Thus, we get the same rotation whether or not q is a unit quaternion.
The reason why /unit/ quaternions are used is that: firstly, there is
a simple formula for determining q^-1 when q is a known unit
quaternion that doesn't involve finding the inverse of the matrix
representation of q; and secondly, it is easy to determine the unit
quaternion which corresponds to rotation around a vector v through an
angle theta.

5. Does "normalization" basically mean taking a quaternion and
converting it to a "unit quaternion", just like when you take a vector
and divide by its magnitude to get a unit vector? Is a normalized
quaternion just a unit quaternion?


Yes.

Cheers - Chas

.



Relevant Pages

  • Re: Questions regarding quaternions
    ... Take a frame of reference (or measurements ... physical rotation of a body (for ... reference and convert it to a quaternion? ...
    (sci.math)
  • Re: Questions regarding quaternions
    ... The name for b is "translation". ... A rotation changes the orientation of the axes, ... A rotation can be applied by the quaternion operation you cite: ... Next, you rotate XYZ until the X axis correspond to the X' axis, and ...
    (sci.math)
  • Re: Questions regarding quaternions
    ... Take a frame of reference and convert it ... A rotation changes the orientation of the axes, ... A rotation can be applied by the quaternion operation you cite: ... Next, you rotate XYZ until the X axis correspond to the X' axis, and ...
    (sci.math)
  • Re: Quaternion newbie needs help
    ... Quaternions have been promoted by Hamilton, but as reported by Petzold, "James Clerk Maxwell used quaternions in a limited, rather unorthodox manner in his influential Treatise on Electricity and Magnetism, which suggested to some readers that quaternions were more useful without the scalar part." ... we can use a quaternion to store Temperature at a given 3D point. ... It just happens that using quaternions, and some process on them we can define useful rotation about an arbitrary axis if the scalar is the cosinus of half the angle of rotation, and the vector, the direction of the axis times the scalar value of the sinus of half the angle of rotation. ... WPF doesn't really require you to know all that. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Rotation always relative to the world
    ... consists of 4 numbers and represents a rotation about an arbitrary ... You can multiply quaternions together to create a new quaternion that ... ArcBall translates 2D mouse input into 3D quaternion math. ... click outside of the sphere, the method will snap the vector to the nearest ...
    (microsoft.public.win32.programmer.directx.managed)