0% found this document useful (0 votes)
76 views36 pages

Axis Transformation

Uploaded by

anand_316764947
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views36 pages

Axis Transformation

Uploaded by

anand_316764947
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

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

x’ = x cos q – y sin q y’ = y cos q – z sin q


y’ = x sin q + y cos q z’ = y sin q + z cos q
z’ = z x’ = x
3D rotation around axis
parallel to coordinate axis
 Translate object so that rotation axis
aligned with coordinate axis
 Rotate about that axis
 Translate back
3D rotation around any axis
 Translate object so that rotation axis passes through coordinate origin
 Rotate object so that axis of rotation coincides with coordinate axis
 Perform rotation
 Inverse rotate so that rotation axis goes back to original orientation
 Inverse translate so that rotation axis goes back to original position

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:

XYZ XZY XYX XZX


YXZ YZX YXY YZY
ZXY ZYX ZXZ ZYZ
Euler Angles
 This gives us 12 redundant ways to
store an orientation using Euler angles
 Different industries use different
conventions for handling Euler angles
(or no conventions)
Euler Angles to Matrix
Conversion
 To build a matrix from a set of Euler angles,
we just multiply a sequence of rotation
matrices together:
1 0 0  c y 0  s y   cz sz 0
  
R x  R y  R z  0 c x 
sx    0 1 0    s z cz 0
0  s x c x   s y 0 c y   0 0 1
 c y cz c y sz  sy 
 
  sx s y cz  cx sz sx s y sz  cx cz sxc y 
c x s y c z  s x s z cx s y sz  sx cz c x c y 

Euler Angle Order
 As matrix multiplication is not commutative,
the order of operations is important
 Rotations are assumed to be relative to fixed
world axes, rather than local to the object
 One can think of them as being local to the
object if the sequence order is reversed
Using Euler Angles
 To use Euler angles, one must choose
which of the 12 representations they
want
 There may be some practical
differences between them and the best
sequence may depend on what exactly
you are trying to accomplish
Vehicle Orientation
 Generally, for vehicles, it is most convenient
to rotate in roll (z), pitch (x), and then yaw
(y)
y
 In situations where there
is a definite ground plane, front of vehicle
Euler angles can actually
be an intuitive
x
representation
z
Euler Angles

 The orientation of a given reference frame


relative to another reference system is specified
by three angles defined by the three angles Ψ, θ
& Φ which are called Euler angles.

 A continuous display of these three Euler


angles on the cockpit instrumentation enables
the pilot to have a knowledge of the orientation
c
of the aircraft with respect to the Earth
Series of rotations bring it to its
present orientation:
 A clockwise rotation in the horizontal plane,
through the yaw (or heading) angles Ψ,
followed by
 A clockwise rotation about the pitch angle θ,
followed by
 A clockwise rotation about the roll axis,
through the bank angle Φ

The order of these rotations is very important


– a different orientation would result if the
rotations were made in a different order.
Rotation Vectors and
Axis/Angle
 Euler’s Theorem also shows that any two
orientations can be related by a single
rotation about some axis (not necessarily a
principle axis)
 This means that we can represent an
arbitrary orientation as a rotation about some
unit axis by some angle (4 numbers)
(Axis/Angle form)
 Alternately, we can scale the axis by the
angle and compact it down to a single 3D
vector (Rotation vector)
Axis/Angle Representation
 Storing an orientation as an axis and an angle uses 4
numbers, but Euler’s theorem says cthat we only need
3 numbers to represent an orientation
 Mathematically, this means that we are using 4
degrees of freedom to represent a 3 degrees of
freedom value
 This implies that there is possibly extra or redundant
information in the axis/angle format
 The redundancy manifests itself in the magnitude of
the axis vector. The magnitude carries no
c information, and so it is redundant. To remove the
redundancy, we choose to normalize the axis, thus
constraining the extra degree of freedom
Matrix Representation
 We can use a 3x3 matrix to represent an
orientation as well
 This means we now have 9 numbers instead
of 3, and therefore, we have 6 extra degrees
of freedom

 NOTE: We don’t use 4x4 matrices here, as


those are mainly useful because they give us
the ability to combine translations. We will
not be concerned with translation today, so
we will just think of 3x3 matrices.
Quaternions
Quaternions
 Quaternions are an interesting mathematical
concept with a deep relationship with the
foundations of algebra and number theory
 Invented by W.R.Hamilton in 1843
 In practice, they are most useful to us as a
means of representing orientations
 A quaternion has 4 components

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:

The quaternion representing the rotation scalar vector

q = (s, v) where

s = cos q/2 and v = u sin q/2 where


u is the unit vector along the rotation axis and q is the rotation angle
Quaternions (Imaginary
Space)
 Quaternions are actually an extension to complex
numbers
 Of the 4 components, one is a ‘real’ scalar number,
and the other 3 form a vector in imaginary ijk space!
q  q0  iq1  jq2  kq3

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:

1  2q22  2q32 2q1 q 2 2q 0 q 3 2q1 q 3 2q 0 q 2 


 
2q1 q 2 2q 0 q 3 1  2q12  2q32 2q 2 q 3 2q 0 q1 
2q1 q 3 2q 0 q 2 2q 2 q 3 2q 0 q1 1  2q12  2q22 

Quaternion Dot Products
 The dot product of two quaternions works in
the same way as the dot product of two
vectors:
p  q  p0 q0  p1q1  p2 q2  p3 q3  p q cos 

 The angle between two quaternions in 4D


space is half the angle one would need to
rotate from one orientation to the other in 3D
space
c

yaw pitch roll


0]fy, teta,si
z y x
c
Quaternion Euclidean Product
Distance
 Quaternion properties
i 2  j 2  k 2  ijk  1
ij  k , ji  k , jk  i,
kj  i, ki  j , ik   j

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

Multiplication P  Q  (at  bx  cy  dz )  (bt  ax  cz  dy )i 


(ct  ay  dx  bz ) j  (dt  az  by  cx )k

Inner Product  P, Q  at  bx  cy  dz

Quaternion Euclidean Product PQEP  PQ

You might also like