Game Development Reference
In-Depth Information
8.5.10 Quaternion log, exp, and Multiplication by a Scalar
This section discusses three operations on quaternions that, although they
are seldom used directly, are the basis for several important quaternion
operations. These operations are the quaternion logarithm, exponential,
and multiplication by a scalar.
First, let us reformulate our definition of a quaternion by introducing a
variable α to equal the half-angle, θ/2:
Defining a quaternion in
terms of the half-angle α
α = θ/2,
q =
cosα n sinα
.
The logarithm of q is defined as
The logarithm of a
quaternion
cosα n sinα
0 α n
log q = log
.
We use the notation ≡ to mean equal by definition. In general, log q is not
a unit quaternion. Note the similarity between taking the logarithm of a
quaternion, and the exponential map format (see Section 8.4).
The exponential function is defined in the exact opposite manner. First
we define the quaternion p to be of the form [0,α n ], with n a unit vector:
p =
0 α n
,
( n = 1).
Then the exponential function is defined as
The exponential function
of a quaternion
exp p = exp
0 α n
cosα n sinα
.
Note that, by definition, exp p always returns a unit quaternion.
The quaternion logarithm and exponential are related to their scalar
analogs. For any scalar a,
e ln a = a.
In the same way, the quaternion exp function is defined to be the inverse
of the quaternion log function:
exp( log q ) = q .
Finally, quaternions can be multiplied by a scalar, with the result com-
puted in the obvious way of multiplying each component by the scalar.
Given a scalar k and a quaternion q ,
Multiplying a quaternion
by a scalar
k q = k
w v
=
kw k v
.
This will not usually result in a unit quaternion, which is why multiplication
by a scalar is not a very useful operation in the context of representing
angular displacement. (But we will find a use for it in Section 8.5.11.)
Search WWH ::




Custom Search