Spatial Representation 01
Spatial Representation 01
Spatial Representation 01
• manipulative or
2/99 ? i P
Robot
This is commonly understood to be a machine which can be programmed
to perform tasks which involve
• manipulative or
• locomotive
2/99 ? i P
• Manipulator
A manipulator is machine whose mechanism usually consists of a
series of segments jointed or sliding relative to one another.
3/99 ? i P
• Manipulator
A manipulator is machine whose mechanism usually consists of a
series of segments jointed or sliding relative to one another.
3/99 ? i P
Calculating the Pose of an Object
In order to determine a general expression for the pose of one frame
with respect to another we will make use of the fact that the-
translational and rotational components of the pose are indepen-
dent.
4/99 ? i P
Calculating the Pose of an Object
In order to determine a general expression for the pose of one frame
with respect to another we will make use of the fact that the-
translational and rotational components of the pose are indepen-
dent.
4/99 ? i P
Specifying the Translation of One Frame with
Respect to Another
Since we are only considering the translational component of one frame
with respect to another, we can regard the position of the frame as a
point.
5/99 ? i P
Specifying the Translation of One Frame with
Respect to Another
Since we are only considering the translational component of one frame
with respect to another, we can regard the position of the frame as a
point.
5/99 ? i P
zA {A} A
P
yA
xA
6/99 ? i P
Given that we are tying to specify the position of a point with respect to
set of axes we can use a 3 1 vector.
A
PBorg = [ px py pz ] T
The expression above specifies the position of the origin of frame {B}
with respect to the principal directions of {A}.
7/99 ? i P
If we knew
• then the position of the point P with respect to frame {A} is,
A
P = P + PBorg
B A
8/99 ? i P
zB B
P
A
P
zA yB
{B}
A
P
xB
Borg
yA
{A}
xA
9/99 ? i P
[·]T indicates the transpose of the vector
{·} Braces indicates the frame of reference
P Capitals indicate a vector
10/99 ? i P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal
11/99 ? i P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal
A
PB The subscript indicates that the vector is used to specify
11/99 ? i P
A
P The leading superscript (i.e A) indicates the comments of
the vector are along the directions indicated by the principal
A
PB The subscript indicates that the vector is used to specify
11/99 ? i P
Specifying the Orientation of One Frame with
Respect to Another
In order to specify the rotation of one frame with respect to another we
need to specify the direction of each of the principal axes in question in
terms of the principal axes of our reference frame.
12/99 ? i P
Specifying the Orientation of One Frame with
Respect to Another
In order to specify the rotation of one frame with respect to another we
need to specify the direction of each of the principal axes in question in
terms of the principal axes of our reference frame.
For simplicity we will consider two frames whose origins are coincident
but are rotated with respect to one another.
12/99 ? i P
The directions of the principal axes of frame {B} with respect to the
axes of frame {A} can be found by taking each of the axes of {B} in
turn and forming a dot product with the axes of frame {A}.
A
ZB = [ ZB · XA, ZB ·YA, ZB · ZA ]T = [ r13, r23, r33 ]T
13/99 ? i P
zA
ZB
r22
yA
r13
r23
xA
14/99 ? i P
When calculated for all the principal axes of {B} we obtain a 33 matrix
B R which specifies the rotation of
A {B} with respect to {A}.
⎡ ⎤
r11 r12 r13
⎢ ⎥
⎢ ⎥
A
RB = ⎢ r21 r22 r23 ⎥
⎣ ⎦
r31 r32 r33
15/99 ? i P
Observations
• Often we only need to specify two of the three principal axes as the
A
ZB × YB = XB
A A
16/99 ? i P
Observations
• Often we only need to specify two of the three principal axes as the
A
ZB × YB = XB
A A
• A RB = (B RA )−1 = (B RA )T
16/99 ? i P
Observations
• Often we only need to specify two of the three principal axes as the
third can found from the cross product e.g
A
ZB × YB = XB
A A
• A RB = (B RA )−1 = (B RA )T
16/99 ? i P
Specifying the Pose of an Frame with Respect
to Another
A
P = P + PBorg
B A
where B P represents the position of the point P in {B} for the purely
translational case.
17/99 ? i P
However in the general case, the position of {A} may also be rotated
A
P = RB. P + PBorg
A B A
18/99 ? i P
A T {B}
P= [ px, py, pz ] zB
Borg
{A}
zA A
P yB
Borg
px
xB p
z
yA
py
xA
19/99 ? i P
Homogeneous Transforms
20/99 ? i P
• Homogeneous Transforms have a number of advantages when used
as the means of specifying spatial relationships
21/99 ? i P
• Homogeneous Transforms have a number of advantages when used
as the means of specifying spatial relationships
• They are not the only means to specify pose in robotic systems be
they are the mostly commonly used method.
21/99 ? i P
• Homogeneous Transforms (HTs) allow us to treat the rotational and
translational components of the pose as a single operation.
22/99 ? i P
• Homogeneous Transforms (HTs) allow us to treat the rotational and
translational components of the pose as a single operation.
examples as
A
P = TB . P
A B
22/99 ? i P
• There is an efficient method for the calculation of the inverse.
23/99 ? i P
• There is an efficient method for the calculation of the inverse.
• They also have use in computer graphics and solid modelling since
they also be used to represent shearing and changes in size.However
often such applications use left handed frames
23/99 ? i P
• There is an efficient method for the calculation of the inverse.
• They also have use in computer graphics and solid modelling since
they also be used to represent shearing and changes in size.However
often such applications use left handed frames
23/99 ? i P
The 3x1 vector
P = [x, y, x]T
becomes a 4x1 vector
24/99 ? i P
The 3x1 vector
P = [x, y, x]T
becomes a 4x1 vector
P = [abcn] T
where
a b c
x= ,y= ,z=
n n n
24/99 ? i P
In such a representation
• [ 0 0 0 0 ]T is undefined
25/99 ? i P
In such a representation
• [ 0 0 0 0 ]T is undefined
25/99 ? i P
Commonly used Homogeneous Transforms
We can re-write our general expression for pose in terms of our previous
rotational and translational components using HTs as
⎡ ⎤ ⎡ ⎤
A A A
P RB PBorg
⎣ ⎦=⎣ ⎦
1 000 1
26/99 ? i P
The HT to perform a translation within the current frame is
⎡ ⎤
1 0 0 qx
⎢ ⎥
⎢ ⎥
⎢ 0 1 0 qy ⎥
Trans[qx , qy, qz] = ⎢
⎢
⎥
⎥ Trans
⎢ 0 0 1 qz ⎥
⎣ ⎦
0 0 0 1
27/99 ? i P
⎡ ⎤
sx 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 sy 0 0 ⎥
S[sx , sy, sz] = ⎢
⎢
⎥
⎥ Scaling
⎢ 0 0 sz 0 ⎥
⎣ ⎦
0 0 0 1
28/99 ? i P
and the rotations of [ψ, θ, φ ]about the respective principal axes of the
current frame are
⎡ ⎤
cos φ − sin φ 0 0
⎢ ⎥
⎢ ⎥
⎢ sin φ cos φ 0 0 ⎥
Rotz(φ) = ⎢
⎢
⎥
⎥ Roll
⎢ 0 0 1 0⎥
⎣ ⎦
0 0 0 1
29/99 ? i P
⎡ ⎤
cos θ 0 sin θ 0
⎢ ⎥
⎢ ⎥
⎢ 0 1 0 0⎥
Roty(θ) = ⎢
⎢
⎥
⎥ Pitch
⎢ − sin θ 0 cos θ 0 ⎥
⎣ ⎦
0 0 0 1
30/99 ? i P
⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 cos ψ − sin ψ 0 ⎥
Rotx (ψ) = ⎢
⎢
⎥
⎥ Yaw
⎢ 0 sin ψ cos ψ 0 ⎥
⎣ ⎦
0 0 0 1
31/99 ? i P
Compound Transforms
B
P =B TC .C P A
P =A TB.BP
32/99 ? i P
Compound Transforms
B
P =B TC .C P A
P =A TB.BP
32/99 ? i P
A
P =A TB.(BTC .C P)
A
P = (ATB.BTC ).C P
and hence
33/99 ? i P
A
P =A TB.(BTC .C P)
A
P = (ATB.BTC ).C P
and hence
A
TC =A TB.BTC
33/99 ? i P
In terms of the HT we have
⎡ ⎤
A
RB.BRC A
RB.BPC +A PB
A
TC = ⎣ ⎦
000 1
34/99 ? i P
Observations
• Although HTs provide a uniform treatment, direct implementation of
the compound operation involves unnecessary multiplications by 0.
35/99 ? i P
Observations
• Although HTs provide a uniform treatment, direct implementation of
the compound operation involves unnecessary multiplications by 0.
35/99 ? i P
• The order in which a compound transformation is generated is im-
portant for the efficiency of the operation
36/99 ? i P
• The order in which a compound transformation is generated is im-
portant for the efficiency of the operation
A
P =A RB.BRC .C RD.DP
and B RC .C RD is calculated followed by A RB .(B RC .C RD )
36/99 ? i P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.
37/99 ? i P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.
37/99 ? i P
• and finally
(ARB.(BRC .C RD)).DP
this process would take 63 multiplications and 43 additions.
37/99 ? i P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps
38/99 ? i P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps
38/99 ? i P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps
38/99 ? i P
Rotation about an arbitrary axis
Rotation about a vector (rx , ry , rz ) by an angle θ passing through the
origin of the reference frame can be achieved by executing the following
steps
38/99 ? i P
which can be expressed as
39/99 ? i P
where
√
sin α = 2
ry
cos α = √ r2z 2
ry +rz2 ry +rz
sin β = rx cos β = ry2 + rz2
40/99 ? i P
giving
⎡ ⎤
rx2V θ +Cθ rx ryV θ − rzSθ rx rzV θ + rySθ
⎢ ⎥
⎢ ⎥
Rotr (θ) = ⎢ rx ryV θ + rzSθ ry2V θ +Cθ ryrzV θ − rx Sθ ⎥
⎣ ⎦
rx rzV θ − rySθ ryrzV θ + rx Sθ rz2V θ +Cθ
41/99 ? i P
Inverting a Homogeneous Transform
We could use standard inversion techniques but it is more efficient to
utilise the structure of the HT and operate on the individual translational
and rotational components.
42/99 ? i P
Inverting a Homogeneous Transform
We could use standard inversion techniques but it is more efficient to
utilise the structure of the HT and operate on the individual translational
and rotational components.
⎡ ⎤
R P
A
TB = ⎣ ⎦
000 1
42/99 ? i P
Let (A TB )−1 have the form
⎡ ⎤
S Q
B
TA = ⎣ ⎦
000 1
43/99 ? i P
we know that
⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢0 1 0 0⎥
A
TB. TA = I = ⎢
B
⎢
⎥
⎥
⎢0 0 1 0⎥
⎣ ⎦
0 0 0 1
where I is the identity.
44/99 ? i P
Hence if multiply the transform and its inverse each of the translational
elements in I .
⎡ ⎤⎡ ⎤ ⎡ ⎤
R P S Q R.S R.Q + P
⎣ ⎦⎣ ⎦=⎣ ⎦
000 1 000 1 000 1
45/99 ? i P
Equating the result to the identity we have R.S = I and R.Q + P = 0
46/99 ? i P
Equating the result to the identity we have R.S = I and R.Q + P = 0
46/99 ? i P
Equating the result to the identity we have R.S = I and R.Q + P = 0
46/99 ? i P
Example 1 Given {B} is rotated relative to {A} about ZA by 30◦ and
then translated 4.0 units in the direction XA and 3.0 units in the direction
YA , findA TB and B TA
B
TA = Trans(4, 3, 0).Rotz(30◦)
47/99 ? i P
⎡ ⎤⎡ ⎤
1 0 0 4 0.866 −0.5 0 0
⎢ ⎥⎢ ⎥
⎢ ⎥⎢ ⎥
⎢ 0 1 0 3 ⎥ ⎢ 0.5 0.866 0 0 ⎥
B
TA = ⎢ ⎥⎢ ⎥
⎢ ⎥⎢ ⎥
⎢ 0 0 1 0 ⎥⎢ 0 0 0 0⎥
⎣ ⎦⎣ ⎦
0 0 0 1 0 0 1 1
48/99 ? i P
⎡ ⎤
0.866 −0.500 0.000 4.0
⎢ ⎥
⎢ ⎥
⎢ 0.500 0.866 0.000 3.0 ⎥
B
TA = ⎢
⎢
⎥
⎥
⎢ 0.000 0.000 1.000 0 ⎥
⎣ ⎦
0 0 0 1
49/99 ? i P
To find A TB we must invert B TA .
50/99 ? i P
To find A TB we must invert B TA .
nents ⎡ ⎤
[R] [P]
B
TA = ⎣ ⎦
000 1
50/99 ? i P
⎡⎡ ⎤ ⎡ ⎤⎤
0.866 −0.500 0 4
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎢ ⎢ 0.500 0.866 0 ⎥ ⎢3⎥⎥
B
TA = ⎢ ⎣ ⎦ ⎣ ⎦⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎣ ⎦
000 1
51/99 ? i P
Calculating the subparts of the inverse gives us
⎡ ⎤
0.866 0.500 0
⎢ ⎥
−1 ⎢ ⎥
R = R = ⎢ −0.500 0.866 0 ⎥
T
⎣ ⎦
0 0 1
52/99 ? i P
⎡ ⎤⎡ ⎤ ⎡ ⎤
0.866 0.500 0 4 −4.964
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
−R .P = − ⎢ −0.500 0.866 0 ⎥ ⎢ 3 ⎥ = ⎢ −0.598 ⎥
T
⎣ ⎦⎣ ⎦ ⎣ ⎦
0 0 1 0 0
53/99 ? i P
⎡⎡ ⎤ ⎡ ⎤⎤
0.866 −0.500 0 −4.964
⎢⎢ ⎥ ⎢ ⎥⎥
⎢⎢ ⎥ ⎢ ⎥⎥
⎢ ⎢ −0.500 0.866 0 ⎥ ⎢ −0.598 ⎥ ⎥
(BTA)−1 = ⎢
⎢
⎣ ⎦ ⎣ ⎦⎥
⎥
⎢ 0 0 1 0 ⎥
⎣ ⎦
000 1
54/99 ? i P
⎡ ⎤
0.866 0.500 0.000 −4.964
⎢ ⎥
⎢ ⎥
⎢ 0.500 0.866 0.000 −0.598 ⎥
B
TA = ⎢
⎢
⎥
⎥
⎢ 0.000 0.000 1.000 0 ⎥
⎣ ⎦
0 0 0 1
55/99 ? i P
Example 2 : Manipulator Grasping
{W}
y
{T}
x
x
z
x
{G}
y
y
{B} z
{S} z
y
y
x
x
56/99 ? i P
We can use the inverse of standard transformations to provide specifi-
cation of movements for the manipulator.
57/99 ? i P
We can use the inverse of standard transformations to provide specifi-
cation of movements for the manipulator.
57/99 ? i P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.
58/99 ? i P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.
58/99 ? i P
• Station frame {S}
The station frame is also known as the universe frame, task frame
or the world frame.
58/99 ? i P
• Wrist frame {W }
{W } is also affixed to the last link of the manipulator (it is another
name for frame {N} when describing the kinematics of the manip-
ulator).
59/99 ? i P
• Wrist frame {W }
{W } is also affixed to the last link of the manipulator (it is another
name for frame {N} when describing the kinematics of the manip-
ulator).
{W } =B TW =0 TN
59/99 ? i P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.
60/99 ? i P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.
60/99 ? i P
• Tool frame {T }
The tool frame is affixed to the end of the tool (end effector ) which
the manipulator is using.
• The tool frame is always specified with respect to the wrist frame
i.e..
{T } =T Tw
60/99 ? i P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.
61/99 ? i P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.
61/99 ? i P
• Goal frame {G}
The goal frame describes the position that the manipulator is to
move the tool.
61/99 ? i P
In order to move the gripper of the manipulator so that it may grasp the
box we require the pose of the box frame {G} with respect to the tool
frame of the manipulator {T }
T
i.e TG
62/99 ? i P
W
T
{W} T
B
T {T}
W
{G}
S
TG
{B} {S}
B
TS
63/99 ? i P
Example 3 : Manipulator tool frame Another important
transform is the where transform which is calculated to give the posi-
tion of the tool with respect to the station frame i.e. S TT
S
TT =B TS−1.BTW .W TT
64/99 ? i P
Perspective Transformations
65/99 ? i P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane
66/99 ? i P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane
66/99 ? i P
• The perspective transformation (or imaging transformation) projects
three dimensional points on to a plane
66/99 ? i P
A simple model of the imaging process
Assuming that
67/99 ? i P
A simple model of the imaging process
Assuming that
• The centre of the image plan is at the centre of the camera coordi-
nate system
67/99 ? i P
A simple model of the imaging process
Assuming that
• The centre of the image plan is at the centre of the camera coordi-
nate system
67/99 ? i P
image plane x,X
y,Y
(X,Y,Z)
λ
optical centre
of the lens z,Z
(x,y)
68/99 ? i P
• Let us assume that (X,Y, Z)represents an point in the 3d scene
and that Z > λ.
69/99 ? i P
• Let us assume that (X,Y, Z)represents an point in the 3d scene
and that Z > λ.
69/99 ? i P
x
λ = − Z−λ
X
= X
λ−Z
y
λ = − Z−λ
Y
= Y
λ−Z
and so
λX
x = λ−Z
λY
y = λ−Z
70/99 ? i P
Perspective Transformation
transformation P ⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢0 0 0 0⎥
P=⎢
⎢
⎥
⎥
⎢0 0 0 0⎥
⎣ ⎦
0 0 − λ1 1
71/99 ? i P
if
72/99 ? i P
if
cH can be found by
cH = PwH
72/99 ? i P
⎡ ⎤⎡ ⎤ ⎡ ⎤
1 0 0 0 kX kX
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 0 0 0 0 ⎥ ⎢ kY ⎥ ⎢ kY ⎥
cH = PwH = ⎢ ⎥⎢ ⎥=⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 0 0 0 0 ⎥ ⎢ kZ ⎥ ⎢ kZ ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
−kZ
0 0 − λ1 1 k λ +k
73/99 ? i P
The Cartesian form of the coordinates c is obtained by dividing the re-
sult by the fourth element in the matrix.
74/99 ? i P
The Cartesian form of the coordinates c is obtained by dividing the re-
sult by the fourth element in the matrix.
⎡ ⎤ ⎡ ⎤
λX
x
⎢ ⎥ ⎢ λ−Z ⎥
⎢ ⎥ ⎢ ⎥
c=⎢ y ⎥=⎢ λY ⎥
⎣ ⎦ ⎣ λ−Z ⎦
λ
z λ−Z
74/99 ? i P
Inverse Perspective Transformation
wH = P−1cH
75/99 ? i P
Inverse Perspective Transformation
wH = P−1cH
• Let us assume we have a given image point (x0 , y0 , 0).This point
can be expressed in homogeneous form as
75/99 ? i P
⎡ ⎤
kx0
⎢ ⎥
⎢ ⎥
⎢ ky0 ⎥
ch = ⎢
⎢
⎥
⎥
⎢ kz ⎥
⎣ ⎦
k
76/99 ? i P
• The need for z can be explained by considering that any point on the
line which passes through (x0 , y0 , 0) and (0, 0, λ) could correspond
to the point in the image
77/99 ? i P
• The need for z can be explained by considering that any point on the
line which passes through (x0 , y0 , 0) and (0, 0, λ) could correspond
to the point in the image
77/99 ? i P
Thus if we do not have some additional information about the position
of the point in the world which corresponds to the point on the image we
will be unable to recover all of the coordinates of the point in the world.
78/99 ? i P
Given the inverse of P
⎡ ⎤
1 0 0 0
⎢ ⎥
⎢ ⎥
⎢ 0 0 0 0 ⎥
P−1 = ⎢
⎢
⎥
⎥
⎢0 0 0 0⎥
⎣ ⎦
0 0 λ1 1
79/99 ? i P
and wh is thus
⎡ ⎤
kx0
⎢ ⎥
⎢ ⎥
⎢ ky0 ⎥
wH = P cH = ⎢
−1
⎢
⎥
⎥
⎢ kz ⎥
⎣ ⎦
λ +k
kz
80/99 ? i P
and w becomes ⎡ ⎤ ⎡ ⎤
λx0
X
⎢ ⎥ ⎢ λ+z ⎥
⎢ ⎥ ⎢ λy0 ⎥
w=⎢Y ⎥=⎢ ⎥
⎣ ⎦ ⎣ λ+z ⎦
λz
Z λ+z
81/99 ? i P
Rearranging the third element of the vector above so we have z in terms
X = λ (λ − Z)
x0
Y = λ (λ − Z)
y0
82/99 ? i P
• Which shows once again that we require at least knowledge of one
of the world coordinates to determine the exact position of the point
in the world.
83/99 ? i P
• Which shows once again that we require at least knowledge of one
of the world coordinates to determine the exact position of the point
in the world.
83/99 ? i P
Quaternion Representation
84/99 ? i P
A quaternion is a quadruple of ordered real numbers
s, a, b, c
85/99 ? i P
• The units i, j, k of a quaternion may be used to represent the three
basis vectors of a Cartesian set of axes (i.e. x, y, z).
86/99 ? i P
• The units i, j, k of a quaternion may be used to represent the three
basis vectors of a Cartesian set of axes (i.e. x, y, z).
86/99 ? i P
Thus a quaternion Q may be written as a scalar part s and a vector part
v as below,
Q = [s + v] = s + ai + b j + ck
87/99 ? i P
The three basis vectors i, j, k have the property known as cyclical per-
i2 = j2 = k2 = −1
ij = k jk = i ki = j
ji = −k k j = −i ik = − j
88/99 ? i P
The following properties of quaternion algebra hold:
Scalar part of Q s
Vector part of Q ai + b j + ck
Conjugate of Q s − (ai + b j + ck)
89/99 ? i P
Norm of Q s2 + a2 + b2 + c2
s−(ai+b j+ck)
Reciprocal of Q
s2 +a2 +b2 +c2
Unit quaternion s + ai + b j + ck where s2 + a2 + b2 + c2 = 1
90/99 ? i P
Thus quaternions include
91/99 ? i P
Thus quaternions include
91/99 ? i P
Thus quaternions include
91/99 ? i P
Simple Operations on Quaternions
The addition/subtraction of two quaternions is the pairwise addi-
tion/subtraction of the corresponding elements of the two quadruples
92/99 ? i P
Simple Operations on Quaternions
The addition/subtraction of two quaternions is the pairwise addi-
tion/subtraction of the corresponding elements of the two quadruples
92/99 ? i P
The multiplication of two quaternions can be written as
93/99 ? i P
The product of two vectors as two quaternions is a quaternion. If
Q = [0 + v1 ] and Q2 = [0 + v2 ] then using the previous definition gives
94/99 ? i P
The product of two vectors as two quaternions is a quaternion. If
Q = [0 + v1 ] and Q2 = [0 + v2 ] then using the previous definition gives
Q1Q2 = −v1 • v2 + v1 × v2
94/99 ? i P
Quaternion algebra can be employed to efficiently represent rotations
in three dimensional space.
Let us assume
θ
θ
S = sin 2 C = cos 2
95/99 ? i P
Then Rot(n, θ) representing a rotation of an angle θ about an axis n
can be written as
θ θ
Rot(n, θ) = cos + sin n
2 2
96/99 ? i P
Example
A rotation of
◦ ◦ ◦ ◦
(cos 45 + j sin 45 )(cos 45 + k sin 45 )
97/99 ? i P
= ( 12 + i 12 + j 12 + k 12 )
√
= 1
+ i+√j+k 3
2 3 2
= cos 60◦ + sin 60◦ i+√j+k
3
◦
= Rot i+√j+k
3
, 120
Thus the resultant rotation is a rotation of 120◦ about the axis equally
inclined to the i, j, k axes.
98/99 ? i P
Comparative Costs
Operation Quaternion form 3 × 3 R form
R1R2 9+, 16* 15 +, 24 *
Rv 12 +, 22* 6 +, 9 *
99/99 ? i P