Axis Transformation
Axis Transformation
by
G.ANITHA
3D Translation
Similar to 2D translation
x’
1 0 0 tx x
y’ = 0 1 0 ty y
z’ z
1
0 0 1 tz 1
0 0 0 1
3D Rotation
Rotation about the z axis
x’
cos q - sin q 0 0 x
y’ = sin q cos q 0 0 y
z’ 0 0 1 0 z
1 1
0 0 0 1
y
z
3D Rotation Convention
Right-handed Cartesian coordinates
y
y
x
z
x
y z
z
Left-handed: Positive rotation goes counter-
clockwise looking in this direction
x
Rotation about x and y-axes
You can derive the matrices yourself.
Example:
y z
x y
z x
y
y’ 3D rotation around arbitrary axis:
x’
Given: (x0,y0,z0) and vector v
Method:
(x0,y0,z0)
(1) Let v be z’
z’ (2) Derive y’ and x’
(3) Translate by (-x0,-y0,-z0)
x (4) Rotate to line up x’y’z’ with xyz axes (see next
page), call this the rotation R.
(5) Rotate by q about the z axis
z (6) Rotate back (R-1)
(7) Translate by (x0,y0,z0)
Orientation
We will define ‘orientation’ to mean an
object’s instantaneous rotational
configuration
Think of it as the rotational equivalent
of position
Representing Positions
Cartesian coordinates (x,y,z) are an
easy and natural means of representing
a position in 3D space
There are many other alternatives such
as polar notation (r,θ,φ)
Representing Orientations
Is there a simple means of representing a 3D
orientation? (analogous to Cartesian
coordinates?)
Not really.
There are several popular options though:
Euler angles
Rotation vectors (axis/angle)
3x3 matrices
Quaternions
and more…
Euler’s Theorem
Euler’s Theorem: Any two independent
orthonormal coordinate frames can be related
by a sequence of rotations (not more than
three) about coordinate axes, where no two
successive rotations may be about the same
axis.
Not to be confused with Euler angles, Euler
integration, Newton-Euler dynamics, inviscid
Euler equations, Euler characteristic…
Leonard Euler (1707-1783)
Euler Angles
This means that we can represent an orientation with
3 numbers
A sequence of rotations around principle axes is
called an Euler Angle Sequence
Assuming we limit ourselves to 3 rotations without
successive rotations about the same axis, we could
use any of the following 12 sequences:
q q0 q1 q2 q3
Quaternions (Scalar/Vector)
Sometimes, they are written as the
combination of a scalar value s and a vector
value v
q s, v
where
s q0
v q1 q2 q3
Quaternions
Quaternions were developed by Hamilton in 1843. There are based on complex
numbers.
More efficient way to generate arbitrary rotation
Less storage than 4 x 4 matrix
Other advantages:
Easier for smooth rotation,
Numerically more stable than 4x4 matrix
More readable
Consists of a scalar part and a vector part:
q = (s, v) where
i j k ijk 1
2 2 2
i jk kj
j ki ik
k ij ji
Quaternions as Rotations
A quaternion can represent a rotation by an angle θ
around a unit axis a:
q cos a x sin a y sin a z sin
2 2 2 2
or
q cos , a sin
2 2
If a is unit length, then q will be also
Quaternions as Rotations
q q02 q12 q22 q32
cos 2
a sin
2
x
2
a sin
2
y
2
a sin
2
z
2
2 2 2 2
cos 2
2
sin 2
2
a 2
x a y2 a z2
2
cos 2
sin 2
a cos 2
sin 2
2 2 2 2
1 1
Quaternion to Matrix
To convert a quaternion to a rotation
matrix:
Conjugate P a bi cj dk
Modulus P PP a 2 b 2 c 2 d 2 0
Assume Q t xi yj zk | t , x, y, z
Quaternion Euclidean Product
Distance
P Q a t , b x, c y , d z
Equality
Addition P Q (a t ) (b x)i (c y ) j (d z )k
Inner Product P, Q at bx cy dz