<s>
In	O
linear	B-Language
algebra	I-Language
,	O
linear	B-Architecture
transformations	I-Architecture
can	O
be	O
represented	O
by	O
matrices	B-Architecture
.	O
</s>
<s>
for	O
some	O
matrix	O
,	O
called	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
of	O
.	O
</s>
<s>
There	O
are	O
alternative	O
expressions	O
of	O
transformation	B-Algorithm
matrices	I-Algorithm
involving	O
row	O
vectors	O
that	O
are	O
preferred	O
by	O
some	O
authors	O
.	O
</s>
<s>
Matrices	B-Architecture
allow	O
arbitrary	O
linear	B-Architecture
transformations	I-Architecture
to	O
be	O
displayed	O
in	O
a	O
consistent	O
format	O
,	O
suitable	O
for	O
computation	O
.	O
</s>
<s>
This	O
also	O
allows	O
transformations	B-Algorithm
to	O
be	O
composed	B-Application
easily	O
(	O
by	O
multiplying	O
their	O
matrices	B-Architecture
)	O
.	O
</s>
<s>
Linear	B-Architecture
transformations	I-Architecture
are	O
not	O
the	O
only	O
ones	O
that	O
can	O
be	O
represented	O
by	O
matrices	B-Architecture
.	O
</s>
<s>
Some	O
transformations	B-Algorithm
that	O
are	O
non-linear	O
on	O
an	O
n-dimensional	O
Euclidean	O
space	O
Rn	O
can	O
be	O
represented	O
as	O
linear	B-Architecture
transformations	I-Architecture
on	O
the	O
n+	O
1-dimensional	O
space	O
Rn+1	O
.	O
</s>
<s>
These	O
include	O
both	O
affine	B-Algorithm
transformations	I-Algorithm
(	O
such	O
as	O
translation	B-Algorithm
)	O
and	O
projective	B-Algorithm
transformations	I-Algorithm
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
4×4	O
transformation	B-Algorithm
matrices	I-Algorithm
are	O
widely	O
used	O
in	O
3D	O
computer	O
graphics	O
.	O
</s>
<s>
These	O
n+	O
1-dimensional	O
transformation	B-Algorithm
matrices	I-Algorithm
are	O
called	O
,	O
depending	O
on	O
their	O
application	O
,	O
affine	B-Algorithm
transformation	B-Algorithm
matrices	I-Algorithm
,	O
projective	B-Algorithm
transformation	I-Algorithm
matrices	I-Algorithm
,	O
or	O
more	O
generally	O
non-linear	O
transformation	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
With	O
respect	O
to	O
an	O
n-dimensional	O
matrix	O
,	O
an	O
n+	O
1-dimensional	O
matrix	O
can	O
be	O
described	O
as	O
an	O
augmented	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
The	O
distinction	O
between	O
active	O
and	O
passive	O
transformations	B-Algorithm
is	O
important	O
.	O
</s>
<s>
By	O
default	O
,	O
by	O
transformation	O
,	O
mathematicians	O
usually	O
mean	O
active	O
transformations	B-Algorithm
,	O
while	O
physicists	O
could	O
mean	O
either	O
.	O
</s>
<s>
If	O
one	O
has	O
a	O
linear	B-Architecture
transformation	I-Architecture
in	O
functional	O
form	O
,	O
it	O
is	O
easy	O
to	O
determine	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
A	O
by	O
transforming	O
each	O
of	O
the	O
vectors	O
of	O
the	O
standard	O
basis	O
by	O
T	O
,	O
then	O
inserting	O
the	O
result	O
into	O
the	O
columns	O
of	O
a	O
matrix	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
function	O
is	O
a	O
linear	B-Architecture
transformation	I-Architecture
.	O
</s>
<s>
The	O
matrix	O
representation	O
of	O
vectors	O
and	O
operators	O
depends	O
on	O
the	O
chosen	O
basis	O
;	O
a	O
similar	B-Algorithm
matrix	I-Algorithm
will	O
result	O
from	O
an	O
alternate	O
basis	O
.	O
</s>
<s>
Now	O
,	O
express	O
the	O
result	O
of	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
A	O
upon	O
,	O
in	O
the	O
given	O
basis	O
:	O
</s>
<s>
Yet	O
,	O
there	O
is	O
a	O
special	O
basis	O
for	O
an	O
operator	O
in	O
which	O
the	O
components	O
form	O
a	O
diagonal	B-Algorithm
matrix	I-Algorithm
and	O
,	O
thus	O
,	O
multiplication	O
complexity	O
reduces	O
to	O
.	O
</s>
<s>
With	O
diagonalization	O
,	O
it	O
is	O
often	B-Algorithm
possible	I-Algorithm
to	O
translate	B-Algorithm
to	O
and	O
from	O
eigenbases	O
.	O
</s>
<s>
Most	O
common	O
geometric	B-Algorithm
transformations	I-Algorithm
that	O
keep	O
the	O
origin	O
fixed	O
are	O
linear	O
,	O
including	O
rotation	B-General_Concept
,	O
scaling	O
,	O
shearing	O
,	O
reflection	O
,	O
and	O
orthogonal	O
projection	B-Algorithm
;	O
if	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
is	O
not	O
a	O
pure	O
translation	B-Algorithm
it	O
keeps	O
some	O
point	O
fixed	O
,	O
and	O
that	O
point	O
can	O
be	O
chosen	O
as	O
origin	O
to	O
make	O
the	O
transformation	O
linear	O
.	O
</s>
<s>
In	O
two	O
dimensions	O
,	O
linear	B-Architecture
transformations	I-Architecture
can	O
be	O
represented	O
using	O
a	O
2×2	O
transformation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
A	O
stretch	O
in	O
the	O
xy-plane	O
is	O
a	O
linear	B-Architecture
transformation	I-Architecture
which	O
enlarges	O
all	O
distances	O
in	O
a	O
particular	O
direction	O
by	O
a	O
constant	O
factor	O
but	O
does	O
not	O
affect	O
distances	O
in	O
the	O
perpendicular	O
direction	O
.	O
</s>
<s>
If	O
the	O
two	O
stretches	O
above	O
are	O
combined	O
with	O
reciprocal	O
values	O
,	O
then	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
represents	O
a	O
squeeze	O
mapping	O
:	O
</s>
<s>
For	O
rotation	B-General_Concept
by	O
an	O
angle	O
θ	O
counterclockwise	O
(	O
positive	O
direction	O
)	O
about	O
the	O
origin	O
the	O
functional	O
form	O
is	O
and	O
.	O
</s>
<s>
Similarly	O
,	O
for	O
a	O
rotation	B-General_Concept
clockwise	O
(	O
negative	O
direction	O
)	O
about	O
the	O
origin	O
,	O
the	O
functional	O
form	O
is	O
and	O
the	O
matrix	O
form	O
is	O
:	O
</s>
<s>
For	O
shear	B-Algorithm
mapping	I-Algorithm
(	O
visually	O
similar	B-Algorithm
to	O
slanting	O
)	O
,	O
there	O
are	O
two	O
possibilities	O
.	O
</s>
<s>
A	O
shear	B-Algorithm
parallel	O
to	O
the	O
x	O
axis	O
has	O
and	O
.	O
</s>
<s>
A	O
shear	B-Algorithm
parallel	O
to	O
the	O
y	O
axis	O
has	O
and	O
,	O
which	O
has	O
matrix	O
form	O
:	O
</s>
<s>
Then	O
use	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
:	O
</s>
<s>
Then	O
use	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
:	O
</s>
<s>
As	O
with	O
reflections	O
,	O
the	O
orthogonal	O
projection	B-Algorithm
onto	O
a	O
line	O
that	O
does	O
not	O
pass	O
through	O
the	O
origin	O
is	O
an	O
affine	O
,	O
not	O
linear	O
,	O
transformation	O
.	O
</s>
<s>
Parallel	B-Algorithm
projections	I-Algorithm
are	O
also	O
linear	B-Architecture
transformations	I-Architecture
and	O
can	O
be	O
represented	O
simply	O
by	O
a	O
matrix	O
.	O
</s>
<s>
However	O
,	O
perspective	B-Architecture
projections	I-Architecture
are	O
not	O
,	O
and	O
to	O
represent	O
these	O
with	O
a	O
matrix	O
,	O
homogeneous	O
coordinates	O
can	O
be	O
used	O
.	O
</s>
<s>
To	O
reflect	O
a	O
point	O
through	O
a	O
plane	O
(	O
which	O
goes	O
through	O
the	O
origin	O
)	O
,	O
one	O
can	O
use	O
,	O
where	O
is	O
the	O
3×3	O
identity	B-Algorithm
matrix	I-Algorithm
and	O
is	O
the	O
three-dimensional	O
unit	O
vector	O
for	O
the	O
vector	O
normal	O
of	O
the	O
plane	O
.	O
</s>
<s>
If	O
the	O
L2	O
norm	O
of	O
,	O
,	O
and	O
is	O
unity	O
,	O
the	O
transformation	B-Algorithm
matrix	I-Algorithm
can	O
be	O
expressed	O
as	O
:	O
</s>
<s>
Note	O
that	O
these	O
are	O
particular	O
cases	O
of	O
a	O
Householder	B-Algorithm
reflection	I-Algorithm
in	O
two	O
and	O
three	O
dimensions	O
.	O
</s>
<s>
A	O
reflection	O
about	O
a	O
line	O
or	O
plane	O
that	O
does	O
not	O
go	O
through	O
the	O
origin	O
is	O
not	O
a	O
linear	B-Architecture
transformation	I-Architecture
—	O
it	O
is	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
—	O
as	O
a	O
4×4	O
affine	B-Algorithm
transformation	I-Algorithm
matrix	I-Algorithm
,	O
it	O
can	O
be	O
expressed	O
as	O
follows	O
(	O
assuming	O
the	O
normal	O
is	O
a	O
unit	O
vector	O
)	O
:	O
</s>
<s>
See	O
homogeneous	O
coordinates	O
and	O
affine	B-Algorithm
transformations	I-Algorithm
below	O
for	O
further	O
explanation	O
.	O
</s>
<s>
One	O
of	O
the	O
main	O
motivations	O
for	O
using	O
matrices	B-Architecture
to	O
represent	O
linear	B-Architecture
transformations	I-Architecture
is	O
that	O
transformations	B-Algorithm
can	O
then	O
be	O
easily	O
composed	B-Application
and	O
inverted	O
.	O
</s>
<s>
Row	O
and	O
column	O
vectors	O
are	O
operated	O
upon	O
by	O
matrices	B-Architecture
,	O
rows	O
on	O
the	O
left	O
and	O
columns	O
on	O
the	O
right	O
.	O
</s>
<s>
Since	O
text	O
reads	O
from	O
left	O
to	O
right	O
,	O
column	O
vectors	O
are	O
preferred	O
when	O
transformation	B-Algorithm
matrices	I-Algorithm
are	O
composed	B-Application
:	O
</s>
<s>
If	O
A	O
and	O
B	O
are	O
the	O
matrices	B-Architecture
of	O
two	O
linear	B-Architecture
transformations	I-Architecture
,	O
then	O
the	O
effect	O
of	O
first	O
applying	O
A	O
and	O
then	O
B	O
to	O
a	O
column	O
vector	O
is	O
given	O
by	O
:	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
matrix	O
of	O
the	O
combined	O
transformation	O
A	O
followed	O
by	O
B	O
is	O
simply	O
the	O
product	O
of	O
the	O
individual	O
matrices	B-Architecture
.	O
</s>
<s>
When	O
A	O
is	O
an	O
invertible	O
matrix	O
there	O
is	O
a	O
matrix	O
A−1	O
that	O
represents	O
a	O
transformation	O
that	O
"	O
undoes	O
"	O
A	O
since	O
its	O
composition	O
with	O
A	O
is	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Reflection	O
matrices	B-Architecture
are	O
a	O
special	O
case	O
because	O
they	B-Algorithm
are	I-Algorithm
their	I-Algorithm
own	I-Algorithm
inverses	I-Algorithm
and	O
do	O
n't	O
need	O
to	O
be	O
separately	O
calculated	O
.	O
</s>
<s>
To	O
represent	O
affine	B-Algorithm
transformations	I-Algorithm
with	O
matrices	B-Architecture
,	O
we	O
can	O
use	O
homogeneous	O
coordinates	O
.	O
</s>
<s>
Using	O
this	O
system	O
,	O
translation	B-Algorithm
can	O
be	O
expressed	O
with	O
matrix	O
multiplication	O
.	O
</s>
<s>
All	O
ordinary	O
linear	B-Architecture
transformations	I-Architecture
are	O
included	O
in	O
the	O
set	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
,	O
and	O
can	O
be	O
described	O
as	O
a	O
simplified	O
form	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
.	O
</s>
<s>
Therefore	O
,	O
any	O
linear	B-Architecture
transformation	I-Architecture
can	O
also	O
be	O
represented	O
by	O
a	O
general	O
transformation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
The	O
latter	O
is	O
obtained	O
by	O
expanding	O
the	O
corresponding	O
linear	B-Architecture
transformation	I-Architecture
matrix	O
by	O
one	O
row	O
and	O
column	O
,	O
filling	O
the	O
extra	O
space	O
with	O
zeros	O
except	O
for	O
the	O
lower-right	O
corner	O
,	O
which	O
must	O
be	O
set	O
to	O
1	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
counter-clockwise	O
rotation	B-Algorithm
matrix	I-Algorithm
from	O
above	O
becomes	O
:	O
</s>
<s>
Using	O
transformation	B-Algorithm
matrices	I-Algorithm
containing	O
homogeneous	O
coordinates	O
,	O
translations	O
become	O
linear	O
,	O
and	O
thus	O
can	O
be	O
seamlessly	O
intermixed	O
with	O
all	O
other	O
types	O
of	O
transformations	B-Algorithm
.	O
</s>
<s>
The	O
reason	O
is	O
that	O
the	O
real	O
plane	O
is	O
mapped	O
to	O
the	O
plane	O
in	O
real	O
projective	O
space	O
,	O
and	O
so	O
translation	B-Algorithm
in	O
real	O
Euclidean	O
space	O
can	O
be	O
represented	O
as	O
a	O
shear	B-Algorithm
in	O
real	O
projective	O
space	O
.	O
</s>
<s>
Although	O
a	O
translation	B-Algorithm
is	O
a	O
non-linear	O
transformation	O
in	O
a	O
2-D	O
or	O
3-D	O
Euclidean	O
space	O
described	O
by	O
Cartesian	O
coordinates	O
(	O
i.e.	O
</s>
<s>
it	O
ca	O
n't	O
be	O
combined	O
with	O
other	O
transformations	B-Algorithm
while	O
preserving	O
commutativity	O
and	O
other	O
properties	O
)	O
,	O
it	O
becomes	O
,	O
in	O
a	O
3-D	O
or	O
4-D	O
projective	O
space	O
described	O
by	O
homogeneous	O
coordinates	O
,	O
a	O
simple	O
linear	B-Architecture
transformation	I-Architecture
(	O
a	O
shear	B-Algorithm
)	O
.	O
</s>
<s>
More	O
affine	B-Algorithm
transformations	I-Algorithm
can	O
be	O
obtained	O
by	O
composition	O
of	O
two	O
or	O
more	O
affine	B-Algorithm
transformations	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
given	O
a	O
translation	B-Algorithm
T	O
 '	O
with	O
vector	O
a	O
rotation	B-General_Concept
R	O
by	O
an	O
angle	O
θ	O
counter-clockwise	O
,	O
a	O
scaling	O
S	O
with	O
factors	O
and	O
a	O
translation	B-Algorithm
T	O
of	O
vector	O
the	O
result	O
M	O
of	O
T'RST	O
is	O
:	O
</s>
<s>
When	O
using	O
affine	B-Algorithm
transformations	I-Algorithm
,	O
the	O
homogeneous	O
component	O
of	O
a	O
coordinate	O
vector	O
(	O
normally	O
called	O
w	O
)	O
will	O
never	O
be	O
altered	O
.	O
</s>
<s>
However	O
,	O
this	O
is	O
not	O
true	O
when	O
using	O
perspective	B-Architecture
projections	I-Architecture
.	O
</s>
<s>
Another	O
type	O
of	O
transformation	O
,	O
of	O
importance	O
in	O
3D	O
computer	O
graphics	O
,	O
is	O
the	O
perspective	B-Architecture
projection	I-Architecture
.	O
</s>
<s>
Whereas	O
parallel	B-Algorithm
projections	I-Algorithm
are	O
used	O
to	O
project	O
points	O
onto	O
the	O
image	O
plane	O
along	O
parallel	O
lines	O
,	O
the	O
perspective	B-Architecture
projection	I-Architecture
projects	O
points	O
onto	O
the	O
image	O
plane	O
along	O
lines	O
that	O
emanate	O
from	O
a	O
single	O
point	O
,	O
called	O
the	O
center	O
of	O
projection	B-Algorithm
.	O
</s>
<s>
This	O
means	O
that	O
an	O
object	O
has	O
a	O
smaller	O
projection	B-Algorithm
when	O
it	O
is	O
far	O
away	O
from	O
the	O
center	O
of	O
projection	B-Algorithm
and	O
a	O
larger	O
projection	B-Algorithm
when	O
it	O
is	O
closer	O
(	O
see	O
also	O
reciprocal	O
function	O
)	O
.	O
</s>
<s>
The	O
simplest	O
perspective	B-Architecture
projection	I-Architecture
uses	O
the	O
origin	O
as	O
the	O
center	O
of	O
projection	B-Algorithm
,	O
and	O
the	O
plane	O
at	O
as	O
the	O
image	O
plane	O
.	O
</s>
<s>
More	O
complicated	O
perspective	B-Architecture
projections	I-Architecture
can	O
be	O
composed	B-Application
by	O
combining	O
this	O
one	O
with	O
rotations	O
,	O
scales	O
,	O
translations	O
,	O
and	O
shears	B-Algorithm
to	O
move	O
the	O
image	O
plane	O
and	O
center	O
of	O
projection	B-Algorithm
wherever	O
they	O
are	O
desired	O
.	O
</s>
