Re: Questions regarding quaternions
- From: cbrown@xxxxxxxxxxxxxxxxx
- Date: 28 Feb 2007 13:18:32 -0800
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
.
- Follow-Ups:
- Re: Questions regarding quaternions
- From: Zerex71
- Re: Questions regarding quaternions
- From: Zerex71
- Re: Questions regarding quaternions
- References:
- Questions regarding quaternions
- From: Zerex71
- Questions regarding quaternions
- Prev by Date: Re: ZFC in another shape.
- Next by Date: Re: Review of Mueckenheims book.
- Previous by thread: Questions regarding quaternions
- Next by thread: Re: Questions regarding quaternions
- Index(es):
Relevant Pages
|