You are on page 1of 46

1

Vectors, Matrices, Rotations,


Axis Transformations

Texture, Microstructure & Anisotropy


A.D. Rollett

Most of the material in these slides originated 
in lecture notes by Prof. Brent Adams (now 
emeritus at BYU). Last revised: 9 Nov. ‘11
2

Notation

u (ui) vector
X point (row or column)
1,xr
x||u|| 2,x3L2
coordinates
norm of a of a point
vector
u (A
A uij) general
vector second rank tensor (matrix)
o
l origin
eigenvalue
e
vˆ3 eigenvector
base vector (3 dirn.)
n
I1 coefficient
Identity of a vector
matrix
A
δijT Kroneckerofdelta
transpose matrix
eijk r rotation
n, permutation
axis tensor
q
aij,Lij rotation
rotation angle
matrix (passive)
tr or, axis
tracetransformation
(of a matrix)

gij3 3D Euclidean
rotation matrixspace
(active*)

* in most texture books, g denotes an axis transformation, or passive rotation!
3

Points, vectors, tensors, dyadics


• Material points of the crystalline sample, of
which x and y are examples, occupy a subset
of the three-dimensional Euclidean point
space, 3, which consists of the set of all
ordered triplets of real numbers, {x1,x2,x3}.
The term point is reserved for elements of 3.

The numbers x1,x2,x3 describe the location of


the point x by its Cartesian coordinates.
Cartesian; from René Descartes, a French mathematician, 1596 to 1650.
4

VECTORS

• The difference between any two points


3
x, ydefines
∈ ℜ a vector according to r the relation
r
. vAs y- x denotes thev directed
=such
line segment with its origin at x and its
terminus at y. Since it possesses both a
direction and a length the vector is an
appropriate representation for physical
quantities such as force, momentum,
displacement, etc.
5

Parallelogram Law
• Two vectors u and v compound (addition) according
to the parallelogram law. If u and v are taken to be
the adjacent sides of a parallelogram (i.e., emanating

r r  r 
from a common origin), then a new vector, w,

w = u + v 
is defined by the diagonal of the parallelogram which
emanates from the same origin. The usefulness of
the parallelogram law lies in the fact that many
physical quantities compound in this way.

6

Coordinate
r
Frame 3
v =v1e ˆ2 +v3eˆ3 = ∑ vie
ˆ1 +v2e ˆi =vi e
ˆi
i =1
• It is convenient to introduce a rectangular
Cartesian coordinate frame for consisting of
the base vectors e ˆ1, eˆ2, and e
ˆ3and a point o
called the origin. These base vectors have
unit length, they emanate from the common
origin o, and they are orthogonal to each
r
another. By virtue of the parallelogram law
any vector v can be expressed as a vector
sum of these three base vectors according to
the expressions
7

Coordinate Frame, contd.


where v1, v2are and v3numbers called the
real
components of in the specified coordinate
system. In the previous equation, the
standard shorthand notation has been
introduced. This is known as the summation
convention. Repeated indices in the same
term indicate that summation over the
repeated index, from 1 to 3, is required. This
notation will be used throughout the text
whenever the meaning is clear.
8

Magnitude of a vector
r

The magnitude, v,  of       is related to its 
components through the parallelogram 
law:
2 2 2 2
v =v +v +v =v v
1 2 3 i i

You will also encounter this quantity as the 
“L2 Norm” in matrix­vector algebra:

v 2
= v = v + v + v = v iv i
2
1
2
2
2
3
9

Scalar Product (Dot product)


• The scalar product u•v of the two vectors
and whose directions are separated by the
r r 
angle q is the scalar quantity
u ⋅ v = uv cosθ = uiv i
where u and v are the magnitudes of u and
v respectively. Thus, u•v is the product of the
projected length of one of the two vectors
with the length of the other. Evidently the
scalar product is commutative, since:
r r  r  r 
u ⋅ v = v ⋅ u 
10

Cartesian coordinates
• There are many instances where the scalar
r r
product has significance in physical theory.
Note v 
r r that if u  and are perpendicular r r  then
u ⋅ v  =0, if they are parallelrthen
r  u ⋅ v =uv ,
and if they are antiparallel u ⋅ v =-uv. Also,
the Cartesian coordinates of a point x, with
respect to the chosen base vectors and
€coordinate origin, are defined by the scalar

product €

ˆi
xi =(x −o) ⋅e
11
• For the base vectors themselves the following
relationships exist
⎧1 if i=j
ˆi ⋅eˆj =δij =⎨
e
⎩0 if i≠j
The symbol δij is called the Kronecker delta.
Notice that the components of the Kronecker
delta can be arranged into a 3x3 matrix, I,
where the first index denotes the row and the
second index denotes the column. I is called
the unit matrix; it has value 1 along the
diagonal and zero in the off-diagonal terms.
12

Vector Product (Cross Product)


r r  r
r vector
• The product u × v of vectors u and
v  is the rvector normal
r to the plane
containing u  and v , and oriented in the
r of
sense r a right-handed screwrrotating
r  from
u  v  u × v  of
to . The magnitude
€ by uv sinq, which
is given € corresponds
r rto the
r u r  by v  and
area of the parallelogram bounded
€ . A convenient expressionu × for v  in

terms of components employs the alternating
symbol, e or  €
r r 
u × v = e ijk
ˆ 

i u j v k

€ €
13

Permutation tensor, eijk


⎧1 if ijk = 123,312 or 231 (even permutations of

eijk =⎨-1 if ijk = 132,213 or 321 (odd permutations of

⎩0 if any two of ijk are equal

r  r  r 
• Related to the vector and scalar products is
the triple scalar product ( u × v )⋅ w which
expresses the volume of the parallelipipedrr
bounded r v 
on three sides by the vectors u ,
and w . In component form it is given by
r  r  r 
( u ×€v ) ⋅ w = eijk ui v j w k
14

Handed-ness of Base Vectors


• With regard to the set of orthonormal base
vectors, these are usually selected in such a
manner that ˆ1 ×e
(e ˆ2) ⋅eˆ3 =+1
.

Such a coordinate basis is termed right


handed. If on the other hand
ˆ1 ×e
(e ˆ2), ⋅then
eˆ3 the
=− 1
basis is left
handed.
15

CHANGES OF THE
COORDINATE SYSTEM
• Many different choices are possible for the
orthonormal base vectors and origin of the
Cartesian coordinate system. A vector is an
example of an entity which is independent of
the choice of coordinate system. Its direction
and magnitude must not change (and are, in
fact, invariants), although its components will
change with this choice.
16

New Axes
• Consider a new orthonormal system consisting of
right-handed base vectors eˆ′, e
1ˆ′ ande
2 ˆ′ 3
with the same origin, o, associated with

and ˆ 1, e 
e  ˆ 2  and e 
ˆ 3 ^
e’3
^
e3
r
The vector v ^
e’2
^
is clearly expressed equally well e2
€ r
in either coordinate system:
^ ^
v =vieˆi =vi′e
ˆi′ e1 e’ 1

Note - same vector, different values of the


components. We need to find a relationship between
the two sets of components for the vector.
17

Direction Cosines
• The two systems are related by the nine
direction cosines, aij , which fix the cosine of
the angle between the ith primed and the jth
unprimed base vectors:
ˆi′ ⋅eˆj
aij =e
Equivalently, aij represent the components
ˆi′ in e
of e ˆj according to the expression
ˆi′ =aijeˆj
e
18

Direction Cosines, contd.


• That the set of direction cosines are not
independent is evident from the following
construction:
ˆi′ ⋅ e
e ˆ′j =aikajl e
ˆk ⋅ e
ˆl =aikajlδkl =aikajk =δij
Thus, there are six relationships (i takes
values from 1 to 3, and j takes values from 1
to 3) between the nine direction cosines, and
therefore only three are independent.
19

Orthogonal Matrices
• Note that the direction cosines can be
arranged into a 3x3 matrix, L, and therefore
the relation above is equivalent to the
expression
T
ΛΛ =I
where L T denotes the transpose of L. This
relationship identifies L as an orthogonal
matrix, which has the properties

−1 T
Λ =Λ detΛ =±1
20

Relationships
• When both coordinate systems are right-handed,
det(L)=+1 and L is a proper orthogonal matrix.
v v  ˆ i′ = aij e 
ˆ j
v €= Λv  ; e 
The orthogonality of L also insures that, in addition to
the relation above, the following holds:
ˆj =aij e
e ˆi′
€ Combining these relations leads to the following inter-
relationships between components of vectors in the
two coordinate systems:
v T v  v  v 
v = Λ v ′ , v i = a jiv ′j  , v ′ = Λv , v ′j  = a jiv i
21

Transformation Law
• These relations are called the laws of
transformation for the components of vectors.
They are a consequence of, and equivalent
to, the parallelogram law for addition of
vectors. That such is the case is evident
when one considers the scalar product
expressed in two coordinate systems:

r r 
u ⋅ v = uiv i = a ji u ′j akiv ′k  =
a ji aki u ′j v ′k  = δ jk u ′j v ′k  = u ′j v ′j  = u ′iv 
  ′i  
22

Invariants
Thus, the transformation law as expressed preserves
the lengths and the angles between vectors. Any
function of the components of vectors which remains
unchanged upon changing the coordinate system is
called an invariant of the vectors from which the
components are obtained. The derivations illustrate
the fact that the scalar product,
r r 
u ⋅ v 
is an invariant of the vectors u and v.
Other examples of invariants include the vector
product of two vectors and the triple scalar product of
three vectors. Note that the transformation law for

vectors also applies to the components of points
when they are referred to a common origin.
23

Rotation Matrices

⎛a  11 a12 a13 ⎞ 


⎜  ⎟ 
€ € aij = ⎜a  21 a22 a23 ⎟ 
⎜  ⎟ 
⎝a  31 a32 a33 ⎠ 

Since an orthogonal matrix merely rotates a 
vector but does not change its length, the 

determinant is one, det(L)=1.  
24

Orthogonality
• A rotation matrix, L, is an orthogonal matrix,
however, because each row is mutually
orthogonal to the other two.

akiakj =δij , aikajk =δij


• Equally, each column is orthogonal to the
other two, which is apparent from the fact that
each row/column contains the direction
cosines of the new/old axes in terms of the
old/new axes and we are working with
[mutually perpendicular] Cartesian axes.
25

Vector realization of rotation

n^
• The convenient way to v
think about a rotation v’
is to draw a plane that
is normal to the rotation
axis. Then project the
vector to be rotated onto €
this plane, and onto the
rotation axis itself.
• Then one computes the vector product of the rotation
axis and the vector to construct a set of 3 orthogonal
vectors that can be used to construct the new, rotated
vector.
26

Vector realization of rotation


• One of the vectors
n^
does not change v
during the rotation. v’

The other two can be ˆ  v ) n 
(n • ˆ 
used to construct the
new vector.


€ ˆ 
n × v 
r r 
ˆ  v ) n 
v − ( n • ˆ 
r  r  r  r 
ˆ  v + (1 − cosθ )( n 
v €= g⋅ v = (cosθ )v + (sinθ ) n × ˆ ⋅ v ) n 
ˆ 
Note that this equation does not require any specific€coordinate
system; we will see similar equations for the action of matrices,

Rodrigues vectors and (unit) quaternions
27

Rotations (Active): Axis- Angle Pair


A rotation is commonly written as (  ,q) or 
r ˆ 

as (n,w). The figure illustrates the effect


of a rotation about an arbitrary axis,
OQ (equivalent to and n) through an
r ˆ 

angle a (equivalent to q and w).

gij = δ ij cosθ − eijk n k sinθ


+ (1− cosθ)n i n j
(This is an active rotation: a 
passive rotation  axis 
transformation)
28

Axis Transformation from Axis-Angle Pair


The rotation can be converted to a matrix 
(passive rotation) by the following expression, 
where d is the Kronecker delta and 
 is the permutation tensor; note the 
change of sign on the off­diagonal terms.
aij =δij cosθ +ri rj (1−cosθ)
+ ∑ εijkrk sinθ
k=1,3
Compare with 
active rotation 
matrix!
29

Rotation Matrix for Axis


Transformation from Axis-Angle Pair
gij = δ ij cosθ + ri rj (1− cosθ )
+ ∑ε r sinθ
ijk k
k=1,3

⎛ cosθ + u 2 (1− cosθ ) uv (1− cosθ ) + w sinθ uw(1− cosθ ) − v sinθ ⎞ 


⎜  ⎟ 
= ⎜uv
  (1− cosθ ) − w sinθ cosθ + v (1− cosθ ) vw(1− cosθ ) + usinθ ⎟ 
2

  (1− cosθ ) + v sinθ vw(1− cosθ ) − usinθ cosθ + w 2 (1− cosθ ) ⎟ 


⎜uw
⎝  ⎠ 

This form of the rotation matrix is a passive


rotation, appropriate to axis transformations
30

Eigenvector of a Rotation
A rotation has a single (real) eigenvector
which is the rotation axis. Since an
eigenvector must remain unchanged by the
action of the transformation, only the rotation
axis is unmoved and must therefore be the
eigenvector, which we will call v.  Note that
this is a different situation from other second
rank tensors which may have more than one
real eigenvector, e.g. a strain tensor.
31

Characteristic Equation

An eigenvector corresponds to a solution of the


characteristic equation of the matrix a, where l
is a scalar:
    av = lv

(a ­ lI)v = 0

det(a ­ lI) = 0
32

Rotation: physical meaning


• Characteristic equation is a cubic and so three
eigenvalues exist, for each of which there is a
corresponding eigenvector.
• Consider however, the physical meaning of a
rotation and its inverse. An inverse rotation
carries vectors back to where they started out
and so the only feature to distinguish it from the
forward rotation is the change in sign. The
inverse rotation, a-1 must therefore share the
same eigenvector since the rotation axis is the
same (but the angle is opposite).
33

Forward vs. Reverse Rotation


Therefore we can write:

a v = a­1 v = v,

and subtract the first two quantities.

(a – a­1) v = 0.

The resultant matrix, (a – a­1) clearly


has zero determinant (required for non-trivial
solution of a set of homogeneous equations).
34

Eigenvalue = +1
• To prove that (a - I)v = 0 (l = 1):

Multiply by aT: aT(a - I)v = 0


(aTa - aT)v = 0
(I - aT)v = 0. Orthogonal matrix 
• Add the first and last equations: property
(a - I)v + (I - aT)v = 0
(a - aT)v = 0.
• If aTa≠I, then the last step would not be valid.
• The last result was already demonstrated.
35

Rotation Axis from Matrix


One can extract the rotation axis, n, 
(the only real eigenvector, same as v in previous
slides, associated with the eigenvalue whose
value is +1) in terms of the matrix coefficients for 
(a - aT)v = 0, with a suitable normalization to obtain
a unit vector:

(a23 −a32),(a31 −a13),(a12 −a21)


n= 2 2 2
(a23 −a32) +(a31 −a13) +(a12 −a21)
Note the order (very important) of the coefficients in each subtraction; 
again, if the matrix represents an active rotation, then the sign is inverted.
36

Rotation Axis from Matrix, contd.


(a – a­1) =  ⎛  0 a12 − a21 a13 − a31 ⎞ 
⎜  ⎟ 
⎜a  21 − a12 0 a23 − a32 ⎟ 
⎜  ⎟ 
⎝a  31 − a13 a32 − a23 0 ⎠ 

Given this form of the difference matrix,


based on a­1 = aT, the only non-zero vector that
€ (a – a­1) n = 0 is:
will satisfy 

(a23 −a32),(a31 −a13),(a12 −a21)


nˆ = 2 2 2
(a23 −a32) +(a31 −a13) +(a12 −a21)
37

Rotation Angle from Matrix


Another useful relation gives us the magnitude of the
rotation, q, in terms of the
trace of the matrix, aii:

aii = 3cosθ + (1− cosθ)n i2 = 1+ 2cosθ


, therefore,

cos q = 0.5 (trace(a) – 1).


€ - In numerical calculations, it can happen that tr(a)-1 is either slightly greater
than 1 or slightly less than -1. Provided that there is no logical error, it is
reasonable to truncate the value to +1 or -1 and then apply ACOS.
- Note that if you try to construct a rotation of greater than 180° (which is
perfectly possible using the formulas given), what will happen when you extract
the axis-angle is that the angle will still be in the range 0-180° but you will
recover the negative of the axis that you started with. This is a limitation of the
rotation matrix (which the quaternion does not share).
38

(Small) Rotation Angle from Matrix


⎛ cosθ + u 2 (1− cosθ ) uv (1− cosθ ) + w sinθ uw(1− cosθ ) − v sinθ ⎞ 
⎜  ⎟ 
gij = ⎜uv
  (1− cosθ ) − w sinθ cosθ + v (1− cosθ ) vw (1− cosθ ) + usinθ ⎟ 
2

 
⎜uw ⎟ 
⎝  (1− cosθ ) + v sinθ vw (1− cosθ ) − usinθ cosθ + w (1− cosθ ) ⎠ 
2

⎛  0 uv (1− cosθ ) + w sinθ uw(1− cosθ ) − v sinθ ⎞ 


⎜  ⎟ 
⇒ g − I = ⎜uv
  (1− cosθ ) − w sinθ 0 vw (1− cosθ ) + usinθ ⎟ 
 
⎜uw ⎟ 
⎝  (1− cosθ ) + v sinθ vw (1− cosθ ) − usinθ 0 ⎠ 
⇒ ω = {2usinθ 2v sinθ 2w sinθ }

What this shows is that for small angles, it is safer to use a sine-based formula to extract the angle
(be careful to include only a12-a21, but not a21-a12). However, this is strictly limited to angles less than

90° because the range of ASIN is -π/2 to +π/2, in contrast to ACOS, which is 0 to π, and the formula
below uses the squares of the coefficients, which means that we lose the sign of the (sine of the)
angle. Thus, if you try to use it generally, it can easily happen that the angle returned by ASIN is,
in fact, π-q because the positive and the negative versions of the axis will return the same value.

2
⎛ε  ijk a jk ⎞ 
sinθ = ∑⎜  ⎟ 
i ⎝  2 ⎠ 
39

Rotation Angle = 180°


A special case is when the rotation, q, is equal to 180°
(=π). The matrix then takes the special form:

  2 −1 2uv
⎛2u 2uw ⎞ 
⎜  ⎟ 
gij = δ ij cosπ + ri rj (1− cosπ ) + ∑ε ijk rk sinπ = ⎜  2uv 2v −1 2vw ⎟ 
2

k=1,3 ⎜  2uw 2vw 2w 2


−1⎟ 
⎝  ⎠ 

In this special case, the axis is obtained thus:


⎧  a + 1 a22 + 1 a33 + 1 ⎫ 
ˆ  ⎨  11
n = ⎬ 
⎩  2 2 2 ⎭ 
However, numerically, the standard procedure is surprisingly robust
and, apparently, only fails when the angle is exactly 180°.
40

race of the (mis)orientation matri


tr [ € a ] = cos € cos € € sin € sin € cos €
1 2 1 2

€ sin € sin € + cos € cos € cos €


1 2 1 2

+ cos €

= cos Φ + ( 1 + cos Φ )(cos ϕ cos ϕ − sin ϕ sin ϕ )


1 2 1 2

= cos Φ + ( 1 + cos Φ ) ( cos { ϕ + ϕ } )


1 2

Thus the cosine, v, of the rotation angle, 
v=cosq, expressed in terms of the Euler angles:
tr [ Δ a ] − 1
2 2
Φ Φ
€ = = cos cos { ϕ + ϕ } − sin
( ) 1 2 ( )
2 2
2
41

Is a Rotation a Tensor? (yes!)


Recall the definition of a tensor as a quantity that
transforms according to this convention,
where L is an axis transformation,
and a is a rotation:

a’ = LT a L

Since this is a perfectly valid method of


transforming a rotation from one set of axes
to another, it follows that an active rotation
can be regarded as a tensor. (Think of transforming
the axes on which the rotation axis is described.)
42

Matrix, Miller Indices


• In the following, we recapitulate some results obtained in the
discussion of texture components (where now it should be clearer
what their mathematical basis actually is).
• The general Rotation Matrix, a, can be represented as in the
following:

[100] direction
⎡a11 a12 a13⎤
⎢ ⎥
[010] direction ⎢a21 a22 a23⎥
⎢ ⎥
[001] direction ⎣a31 a32 a33⎦
• Where the Rows are the direction cosines for [100], [010], and [001]
in the sample coordinate system (pole figure).
43

Matrix, Miller Indices


• The columns represent components of three other unit vectors:

[uvw]RD TD ND(hkl)

⎡a11 a12 a13⎤


⎢ ⎥
⎢a21 a22 a23⎥
⎢ ⎥
⎣a31 a32 a33⎦

• Where the Columns are the direction cosines (i.e. hkl or uvw) for the
RD, TD and Normal directions in the crystal coordinate system.
44

Compare Matrices

[uvw] (hkl) [uvw] (hkl)


Sample
⎛ cosϕ1 cosϕ2 sinϕ1 cosϕ2 ⎞
⎛b1 t1 n1⎞ ⎜ −sinϕ1sinϕ2 cosΦ +cosϕ1sinϕ2 cosΦ

sinϕ 2 sinΦ ⎟

aij =Crystal⎜b2 t2 n2⎟


⎜ ⎟
⎜−cosϕ1sinϕ2 −sinϕ1sinϕ2 cosϕ2 sinΦ⎟
⎜ ⎟
⎜ ⎟ ⎜−sinϕ 1cos ϕ 2 cos
Φ +cosϕ 1cosϕ 2 cos
Φ ⎟
⎝b3 t3 n3⎠ ⎜

⎝ sinϕ1 sinΦ −cosϕ1sinΦ cosΦ ⎠


45

Summary

• The rules for working with vectors and


matrices, i.e. mathematics, especially with
respect to rotations and transformations of
axes, has been reviewed.
46

Supplemental Slides

[none]

You might also like