Matrices
identity matrix:
I
=
[
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
]
I = \left[\begin{matrix} 1 & 0 & 0 & 0 \\ 0 &1 &0 &0 \\ 0&0&1&0\\0&0&0&1\end{matrix}\right]
I=⎣⎢⎢⎡1000010000100001⎦⎥⎥⎤
inverse matrix
A
−
1
A^{-1}
A−1 of
A
A
A:
A
A
−
1
=
I
AA^{-1} = I
AA−1=I
(
A
B
)
−
1
=
B
−
1
A
−
1
(AB)^{-1} = B ^{-1} A^{-1}
(AB)−1=B−1A−1
transpose
A
T
A^T
AT of
A
A
A:
a
i
j
=
a
j
i
′
a_{ij} = a'_{ji}
aij=aji′
[
1
2
3
4
5
6
]
T
=
[
1
3
5
2
4
6
]
\left[\begin{matrix} 1 & 2 \\ 3 &4 \\ 5&6\end{matrix}\right]^T = \left[\begin{matrix} 1 &3&5\\2&4&6\end{matrix}\right]
⎣⎡135246⎦⎤T=[123456]
(
A
B
)
T
=
B
T
A
T
(AB)^T=B^TA^T
(AB)T=BTAT
∣
A
B
∣
=
∣
A
∣
∣
B
∣
|AB| = |A||B|
∣AB∣=∣A∣∣B∣
∣
A
−
1
∣
=
1
∣
A
∣
|A^{-1}| = \frac{1}{|A|}
∣A−1∣=∣A∣1
∣
A
T
∣
=
∣
A
∣
|A^T| = |A|
∣AT∣=∣A∣
a diagonal matrix: where all nonzero elements occur along the diagonal.
I
=
[
8
0
0
0
2
0
0
0
9
]
I = \left[\begin{matrix} 8 & 0 & 0 \\ 0 &2 &0 \\ 0&0&9\end{matrix}\right]
I=⎣⎡800020009⎦⎤
symmetric. matrix:
I
=
[
1
1
2
1
9
7
2
7
1
]
I = \left[\begin{matrix} 1 & 1 & 2 \\ 1 &9 &7 \\ 2&7&1\end{matrix}\right]
I=⎣⎡112197271⎦⎤
orthogonal matrix: for orthogonal
R
R
R
Each of its columns considered as a vector has length 1 and the columns are orthogonal to one another.
R
T
R
=
I
=
R
R
T
R^TR = I = RR^T
RTR=I=RRT
I
=
[
0
1
0
0
0
1
1
0
0
]
I = \left[\begin{matrix} 0 & 1 & 0 \\ 0 &0 &1 \\ 1&0&0\end{matrix}\right]
I=⎣⎡001100010⎦⎤
TransformationMatrices
Scale
s
c
a
l
e
(
s
x
,
s
y
)
=
[
s
x
0
0
s
y
]
scale(s_x, s_y) = \left[\begin{matrix}s_x & 0\\ 0 &s_y \end{matrix}\right]
scale(sx,sy)=[sx00sy]
[
s
x
0
0
s
y
]
[
s
x
s
y
]
=
[
s
x
x
s
y
y
]
\left[\begin{matrix}s_x & 0\\ 0 &s_y \end{matrix}\right] \left[\begin{matrix}s_x \\ s_y \end{matrix}\right] = \left[\begin{matrix}s_xx \\ s_yy \end{matrix}\right]
[sx00sy][sxsy]=[sxxsyy]
Shearing
s
h
e
a
r
−
x
(
s
)
=
[
1
s
0
1
]
,
s
h
e
a
r
−
y
(
s
)
=
[
1
0
s
1
]
shear-x(s) = \left[\begin{matrix}1 & s\\ 0 &1 \end{matrix}\right] , shear-y(s) = \left[\begin{matrix}1 & 0\\ s &1 \end{matrix}\right]
shear−x(s)=[10s1],shear−y(s)=[1s01]
Rotation
r
o
t
a
t
e
(
θ
)
=
[
cos
θ
−
sin
θ
sin
θ
cos
θ
]
rotate(\theta)=\left[\begin{matrix}\cos\theta & -\sin\theta \\ \sin\theta &\cos\theta \end{matrix}\right]
rotate(θ)=[cosθsinθ−sinθcosθ]
Reflection
r e f l e c t i o n − x ( s ) = [ − 1 0 0 1 ] , r e f l e c t i o n − y ( s ) = [ 1 0 0 − 1 ] reflection-x(s) = \left[\begin{matrix}-1 & 0\\ 0 &1 \end{matrix}\right] , reflection-y(s) = \left[\begin{matrix}1 & 0\\ 0 &-1 \end{matrix}\right] reflection−x(s)=[−1001],reflection−y(s)=[100−1]
Composition and Decomposition of Transformations
f
i
r
s
t
,
v
2
=
S
v
1
,
t
h
e
n
,
v
3
=
R
v
2
=
>
v
3
=
R
(
S
v
1
)
=
>
v
3
=
(
R
S
)
v
1
,
M
=
R
S
first,v_2=Sv_1,then,v_3=Rv_2 => v_3 = R(Sv_1) => v_3 = (RS)v_1 , M = RS
first,v2=Sv1,then,v3=Rv2=>v3=R(Sv1)=>v3=(RS)v1,M=RS
It is very important to remember that these transforms are applied from the right side first.
M = RS first applies S and then R
3D Linear Transformations
Scale 3D
s c a l e ( s x , s y , s z ) = [ s x 0 0 0 s y 0 0 0 s z ] scale(s_x, s_y, s_z) = \left[\begin{matrix}s_x & 0 & 0\\ 0 &s_y & 0\\ 0 & 0 & s_z \end{matrix}\right] scale(sx,sy,sz)=⎣⎡sx000sy000sz⎦⎤
Shearing 3D
s h e a r − x ( d y , d z ) = [ 1 d y d z 0 1 0 0 0 1 ] shear-x(d_y,d_z) = \left[\begin{matrix}1 & d_y & d_z\\ 0 &1 &0 \\ 0&0&1\end{matrix}\right] shear−x(dy,dz)=⎣⎡100dy10dz01⎦⎤
Rotate 3D
r
o
t
a
t
e
−
z
(
θ
)
=
[
cos
θ
−
sin
θ
0
sin
θ
cos
θ
0
0
0
1
]
rotate-z(\theta)=\left[\begin{matrix}\cos\theta & -\sin\theta &0\\ \sin\theta &\cos\theta &0\\0&0&1 \end{matrix}\right]
rotate−z(θ)=⎣⎡cosθsinθ0−sinθcosθ0001⎦⎤
r
o
t
a
t
e
−
x
(
θ
)
=
[
1
0
0
0
cos
θ
−
sin
θ
0
sin
θ
cos
θ
]
rotate-x(\theta)=\left[\begin{matrix}1 & 0 &0 \\ 0 &\cos\theta & -\sin\theta\\0&\sin\theta &\cos\theta \end{matrix}\right]
rotate−x(θ)=⎣⎡1000cosθsinθ0−sinθcosθ⎦⎤
r
o
t
a
t
e
−
y
(
θ
)
=
[
cos
θ
0
sin
θ
0
1
0
−
s
i
n
θ
0
cos
θ
]
rotate-y(\theta)=\left[\begin{matrix}\cos\theta & 0 &\sin\theta \\ 0 &1 &0 \\-sin\theta& 0&\cos\theta \end{matrix}\right]
rotate−y(θ)=⎣⎡cosθ0−sinθ010sinθ0cosθ⎦⎤