<s>
In	O
Euclidean	O
geometry	O
,	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
or	O
affinity	B-Algorithm
(	O
from	O
the	O
Latin	O
,	O
affinis	O
,	O
"	O
connected	O
with	O
"	O
)	O
is	O
a	O
geometric	B-Algorithm
transformation	I-Algorithm
that	O
preserves	O
lines	O
and	O
parallelism	O
,	O
but	O
not	O
necessarily	O
Euclidean	O
distances	O
and	O
angles	O
.	O
</s>
<s>
More	O
generally	O
,	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
is	O
an	O
automorphism	O
of	O
an	O
affine	O
space	O
(	O
Euclidean	O
spaces	O
are	O
specific	O
affine	O
spaces	O
)	O
,	O
that	O
is	O
,	O
a	O
function	O
which	O
maps	B-Algorithm
an	O
affine	O
space	O
onto	O
itself	O
while	O
preserving	O
both	O
the	O
dimension	O
of	O
any	O
affine	O
subspaces	O
(	O
meaning	O
that	O
it	O
sends	O
points	O
to	O
points	O
,	O
lines	O
to	O
lines	O
,	O
planes	O
to	O
planes	O
,	O
and	O
so	O
on	O
)	O
and	O
the	O
ratios	O
of	O
the	O
lengths	O
of	O
parallel	O
line	O
segments	O
.	O
</s>
<s>
Consequently	O
,	O
sets	O
of	O
parallel	O
affine	O
subspaces	O
remain	O
parallel	O
after	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
.	O
</s>
<s>
An	O
affine	B-Algorithm
transformation	I-Algorithm
does	O
not	O
necessarily	O
preserve	O
angles	O
between	O
lines	O
or	O
distances	O
between	O
points	O
,	O
though	O
it	O
does	O
preserve	O
ratios	O
of	O
distances	O
between	O
points	O
lying	O
on	O
a	O
straight	O
line	O
.	O
</s>
<s>
If	O
is	O
the	O
point	O
set	O
of	O
an	O
affine	O
space	O
,	O
then	O
every	O
affine	B-Algorithm
transformation	I-Algorithm
on	O
can	O
be	O
represented	O
as	O
the	O
composition	O
of	O
a	O
linear	B-Architecture
transformation	I-Architecture
on	O
and	O
a	O
translation	B-Algorithm
of	O
.	O
</s>
<s>
Unlike	O
a	O
purely	O
linear	B-Architecture
transformation	I-Architecture
,	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
need	O
not	O
preserve	O
the	O
origin	O
of	O
the	O
affine	O
space	O
.	O
</s>
<s>
Thus	O
,	O
every	O
linear	B-Architecture
transformation	I-Architecture
is	O
affine	O
,	O
but	O
not	O
every	O
affine	B-Algorithm
transformation	I-Algorithm
is	O
linear	O
.	O
</s>
<s>
Examples	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
include	O
translation	B-Algorithm
,	O
scaling	B-Algorithm
,	O
homothety	B-Algorithm
,	O
similarity	O
,	O
reflection	B-Algorithm
,	O
rotation	B-General_Concept
,	O
shear	B-Algorithm
mapping	I-Algorithm
,	O
and	O
compositions	O
of	O
them	O
in	O
any	O
combination	O
and	O
sequence	O
.	O
</s>
<s>
Viewing	O
an	O
affine	O
space	O
as	O
the	O
complement	O
of	O
a	O
hyperplane	O
at	O
infinity	O
of	O
a	O
projective	O
space	O
,	O
the	O
affine	B-Algorithm
transformations	I-Algorithm
are	O
the	O
projective	B-Algorithm
transformations	I-Algorithm
of	O
that	O
projective	O
space	O
that	O
leave	O
the	O
hyperplane	O
at	O
infinity	O
invariant	O
,	O
restricted	O
to	O
the	O
complement	O
of	O
that	O
hyperplane	O
.	O
</s>
<s>
A	O
generalization	B-Algorithm
of	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
is	O
an	O
affine	O
map	O
(	O
or	O
affine	O
homomorphism	O
or	O
affine	O
mapping	O
)	O
between	O
two	O
(	O
potentially	O
different	O
)	O
affine	O
spaces	O
over	O
the	O
same	O
field	O
.	O
</s>
<s>
A	O
map	O
is	O
an	O
affine	O
map	O
if	O
there	O
exists	O
a	O
linear	B-Architecture
map	I-Architecture
such	O
that	O
for	O
all	O
in	O
.	O
</s>
<s>
If	O
the	O
dimension	O
of	O
is	O
at	O
least	O
two	O
,	O
a	O
semiaffine	O
transformation	O
of	O
is	O
a	O
bijection	B-Algorithm
from	O
onto	O
itself	O
satisfying	O
:	O
</s>
<s>
These	O
two	O
conditions	O
are	O
satisfied	O
by	O
affine	B-Algorithm
transformations	I-Algorithm
,	O
and	O
express	O
what	O
is	O
precisely	O
meant	O
by	O
the	O
expression	O
that	O
"	O
preserves	O
parallelism	O
"	O
.	O
</s>
<s>
Furthermore	O
,	O
if	O
the	O
field	O
has	O
at	O
least	O
three	O
elements	O
,	O
the	O
first	O
condition	O
can	O
be	O
simplified	O
to	O
:	O
is	O
a	O
collineation	O
,	O
that	O
is	O
,	O
it	O
maps	B-Algorithm
lines	O
to	O
lines	O
.	O
</s>
<s>
Then	O
is	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
of	O
which	O
leaves	O
the	O
point	O
fixed	O
.	O
</s>
<s>
It	O
is	O
a	O
linear	B-Architecture
transformation	I-Architecture
of	O
,	O
viewed	O
as	O
a	O
vector	O
space	O
with	O
origin	O
.	O
</s>
<s>
Let	O
be	O
any	O
affine	B-Algorithm
transformation	I-Algorithm
of	O
.	O
</s>
<s>
Pick	O
a	O
point	O
in	O
and	O
consider	O
the	O
translation	B-Algorithm
of	O
by	O
the	O
vector	O
,	O
denoted	O
by	O
.	O
</s>
<s>
Translations	O
are	O
affine	B-Algorithm
transformations	I-Algorithm
and	O
the	O
composition	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
is	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
.	O
</s>
<s>
That	O
is	O
,	O
an	O
arbitrary	O
affine	B-Algorithm
transformation	I-Algorithm
of	O
is	O
the	O
composition	O
of	O
a	O
linear	B-Architecture
transformation	I-Architecture
of	O
(	O
viewed	O
as	O
a	O
vector	O
space	O
)	O
and	O
a	O
translation	B-Algorithm
of	O
.	O
</s>
<s>
This	O
representation	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
is	O
often	O
taken	O
as	O
the	O
definition	O
of	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
(	O
with	O
the	O
choice	O
of	O
origin	O
being	O
implicit	O
)	O
.	O
</s>
<s>
As	O
shown	O
above	O
,	O
an	O
affine	O
map	O
is	O
the	O
composition	O
of	O
two	O
functions	O
:	O
a	O
translation	B-Algorithm
and	O
a	O
linear	B-Architecture
map	I-Architecture
.	O
</s>
<s>
Ordinary	O
vector	O
algebra	O
uses	O
matrix	O
multiplication	O
to	O
represent	O
linear	B-Architecture
maps	I-Architecture
,	O
and	O
vector	O
addition	O
to	O
represent	O
translations	O
.	O
</s>
<s>
Using	O
an	O
augmented	B-Algorithm
matrix	I-Algorithm
and	O
an	O
augmented	O
vector	O
,	O
it	O
is	O
possible	O
to	O
represent	O
both	O
the	O
translation	B-Algorithm
and	O
the	O
linear	B-Architecture
map	I-Architecture
using	O
a	O
single	O
matrix	O
multiplication	O
.	O
</s>
<s>
The	O
technique	O
requires	O
that	O
all	O
vectors	O
be	O
augmented	O
with	O
a	O
"	O
1	O
"	O
at	O
the	O
end	O
,	O
and	O
all	O
matrices	O
be	O
augmented	O
with	O
an	O
extra	O
row	O
of	O
zeros	O
at	O
the	O
bottom	O
,	O
an	O
extra	O
column	O
—	O
the	O
translation	B-Algorithm
vector	O
—	O
to	O
the	O
right	O
,	O
and	O
a	O
"	O
1	O
"	O
in	O
the	O
lower	O
right	O
corner	O
.	O
</s>
<s>
The	O
above-mentioned	O
augmented	B-Algorithm
matrix	I-Algorithm
is	O
called	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
In	O
the	O
general	O
case	O
,	O
when	O
the	O
last	O
row	O
vector	O
is	O
not	O
restricted	O
to	O
be	O
,	O
the	O
matrix	O
becomes	O
a	O
projective	B-Algorithm
transformation	I-Algorithm
matrix	I-Algorithm
(	O
as	O
it	O
can	O
also	O
be	O
used	O
to	O
perform	O
projective	B-Algorithm
transformations	I-Algorithm
)	O
.	O
</s>
<s>
This	O
representation	O
exhibits	O
the	O
set	O
of	O
all	O
invertible	O
affine	B-Algorithm
transformations	I-Algorithm
as	O
the	O
semidirect	O
product	O
of	O
and	O
.	O
</s>
<s>
Ordinary	O
matrix-vector	O
multiplication	O
always	O
maps	B-Algorithm
the	O
origin	O
to	O
the	O
origin	O
,	O
and	O
could	O
therefore	O
never	O
represent	O
a	O
translation	B-Algorithm
,	O
in	O
which	O
the	O
origin	O
must	O
necessarily	O
be	O
mapped	O
to	O
some	O
other	O
point	O
.	O
</s>
<s>
A	O
translation	B-Algorithm
within	O
the	O
original	O
space	O
by	O
means	O
of	O
a	O
linear	B-Architecture
transformation	I-Architecture
of	O
the	O
higher-dimensional	O
space	O
is	O
then	O
possible	O
(	O
specifically	O
,	O
a	O
shear	B-Algorithm
transformation	I-Algorithm
)	O
.	O
</s>
<s>
The	O
advantage	O
of	O
using	O
homogeneous	O
coordinates	O
is	O
that	O
one	O
can	O
combine	B-Application
any	O
number	O
of	O
affine	B-Algorithm
transformations	I-Algorithm
into	O
one	O
by	O
multiplying	O
the	O
respective	O
matrices	O
.	O
</s>
<s>
This	O
property	O
is	O
used	O
extensively	O
in	O
computer	O
graphics	O
,	O
computer	B-Application
vision	I-Application
and	O
robotics	O
.	O
</s>
<s>
This	O
formulation	O
works	O
irrespective	O
of	O
whether	O
any	O
of	O
the	O
domain	O
,	O
codomain	B-Algorithm
and	O
image	O
vector	O
spaces	O
have	O
the	O
same	O
number	O
of	O
dimensions	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
affine	B-Algorithm
transformation	I-Algorithm
of	O
a	O
vector	O
plane	O
is	O
uniquely	O
determined	O
from	O
the	O
knowledge	O
of	O
where	O
the	O
three	O
vertices	O
(	O
)	O
of	O
a	O
non-degenerate	O
triangle	O
are	O
mapped	O
to	O
(	O
)	O
,	O
regardless	O
of	O
the	O
number	O
of	O
dimensions	O
of	O
the	O
codomain	B-Algorithm
and	O
regardless	O
of	O
whether	O
the	O
triangle	O
is	O
non-degenerate	O
in	O
the	O
codomain	B-Algorithm
.	O
</s>
<s>
An	O
affine	B-Algorithm
transformation	I-Algorithm
preserves	O
:	O
</s>
<s>
As	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
is	O
invertible	O
,	O
the	O
square	B-Algorithm
matrix	I-Algorithm
appearing	O
in	O
its	O
matrix	O
representation	O
is	O
invertible	O
.	O
</s>
<s>
The	O
invertible	O
affine	B-Algorithm
transformations	I-Algorithm
(	O
of	O
an	O
affine	O
space	O
onto	O
itself	O
)	O
form	O
the	O
affine	O
group	O
,	O
which	O
has	O
the	O
general	O
linear	O
group	O
of	O
degree	O
as	O
subgroup	O
and	O
is	O
itself	O
a	O
subgroup	O
of	O
the	O
general	O
linear	O
group	O
of	O
degree	O
.	O
</s>
<s>
The	O
similarity	O
transformations	O
form	O
the	O
subgroup	O
where	O
is	O
a	O
scalar	O
times	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
if	O
the	O
affine	B-Algorithm
transformation	I-Algorithm
acts	O
on	O
the	O
plane	O
and	O
if	O
the	O
determinant	O
of	O
is	O
1	O
or	O
−1	O
then	O
the	O
transformation	O
is	O
an	O
equiareal	B-Algorithm
mapping	I-Algorithm
.	O
</s>
<s>
Each	O
of	O
these	O
groups	O
has	O
a	O
subgroup	O
of	O
orientation-preserving	O
or	O
positive	O
affine	B-Algorithm
transformations	I-Algorithm
:	O
those	O
where	O
the	O
determinant	O
of	O
is	O
positive	O
.	O
</s>
<s>
In	O
the	O
last	O
case	O
this	O
is	O
in	O
3D	O
the	O
group	O
of	O
rigid	B-Algorithm
transformations	I-Algorithm
(	O
proper	B-Algorithm
rotations	I-Algorithm
and	O
pure	O
translations	O
)	O
.	O
</s>
<s>
If	O
there	O
is	O
a	O
fixed	O
point	O
,	O
we	O
can	O
take	O
that	O
as	O
the	O
origin	O
,	O
and	O
the	O
affine	B-Algorithm
transformation	I-Algorithm
reduces	O
to	O
a	O
linear	B-Architecture
transformation	I-Architecture
.	O
</s>
<s>
For	O
example	O
,	O
describing	O
a	O
transformation	O
as	O
a	O
rotation	B-General_Concept
by	O
a	O
certain	O
angle	O
with	O
respect	O
to	O
a	O
certain	O
axis	O
may	O
give	O
a	O
clearer	O
idea	O
of	O
the	O
overall	O
behavior	O
of	O
the	O
transformation	O
than	O
describing	O
it	O
as	O
a	O
combination	O
of	O
a	O
translation	B-Algorithm
and	O
a	O
rotation	B-General_Concept
.	O
</s>
<s>
An	O
affine	O
map	O
between	O
two	O
affine	O
spaces	O
is	O
a	O
map	O
on	O
the	O
points	O
that	O
acts	O
linearly	B-Architecture
on	O
the	O
vectors	O
(	O
that	O
is	O
,	O
the	O
vectors	O
between	O
points	O
of	O
the	O
space	O
)	O
.	O
</s>
<s>
In	O
symbols	O
,	O
determines	O
a	O
linear	B-Architecture
transformation	I-Architecture
such	O
that	O
,	O
for	O
any	O
pair	O
of	O
points	O
:	O
</s>
<s>
followed	O
by	O
the	O
translation	B-Algorithm
by	O
a	O
vector	O
.	O
</s>
<s>
The	O
conclusion	O
is	O
that	O
,	O
intuitively	O
,	O
consists	O
of	O
a	O
translation	B-Algorithm
and	O
a	O
linear	B-Architecture
map	I-Architecture
.	O
</s>
<s>
Felix	O
Klein	O
attributes	O
the	O
term	O
"	O
affine	B-Algorithm
transformation	I-Algorithm
"	O
to	O
Möbius	O
and	O
Gauss	O
.	O
</s>
<s>
In	O
their	O
applications	O
to	O
digital	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
,	O
the	O
affine	B-Algorithm
transformations	I-Algorithm
are	O
analogous	O
to	O
printing	O
on	O
a	O
sheet	O
of	O
rubber	O
and	O
stretching	B-Algorithm
the	O
sheet	O
's	O
edges	O
parallel	O
to	O
the	O
plane	O
.	O
</s>
<s>
This	O
transform	O
relocates	O
pixels	O
requiring	O
intensity	O
interpolation	B-Algorithm
to	O
approximate	O
the	O
value	O
of	O
moved	O
pixels	O
,	O
bicubic	O
interpolation	B-Algorithm
is	O
the	O
standard	O
for	O
image	O
transformations	O
in	O
image	B-Algorithm
processing	I-Algorithm
applications	O
.	O
</s>
<s>
Affine	B-Algorithm
transformations	I-Algorithm
scale	B-Algorithm
,	O
rotate	O
,	O
translate	B-Algorithm
,	O
mirror	O
and	O
shear	B-Algorithm
images	O
as	O
shown	O
in	O
the	O
following	O
examples	O
:	O
</s>
<s>
The	O
affine	B-Algorithm
transforms	I-Algorithm
are	O
applicable	O
to	O
the	O
registration	O
process	O
where	O
two	O
or	O
more	O
images	O
are	O
aligned	O
(	O
registered	O
)	O
.	O
</s>
<s>
An	O
example	O
of	O
image	B-Algorithm
registration	I-Algorithm
is	O
the	O
generation	O
of	O
panoramic	O
images	O
that	O
are	O
the	O
product	O
of	O
multiple	O
images	O
stitched	B-Algorithm
together	O
.	O
</s>
<s>
The	O
affine	B-Algorithm
transform	I-Algorithm
preserves	O
parallel	O
lines	O
.	O
</s>
<s>
However	O
,	O
the	O
stretching	B-Algorithm
and	O
shearing	O
transformations	O
warp	O
shapes	O
,	O
as	O
the	O
following	O
example	O
shows	O
:	O
</s>
<s>
However	O
,	O
the	O
affine	B-Algorithm
transformations	I-Algorithm
do	O
not	O
facilitate	O
projection	B-Algorithm
onto	O
a	O
curved	O
surface	O
or	O
radial	O
distortions	O
.	O
</s>
<s>
Affine	B-Algorithm
transformations	I-Algorithm
in	O
two	O
real	O
dimensions	O
include	O
:	O
</s>
<s>
scaling	B-Algorithm
in	O
a	O
given	O
direction	O
,	O
with	O
respect	O
to	O
a	O
line	O
in	O
another	O
direction	O
(	O
not	O
necessarily	O
perpendicular	O
)	O
,	O
combined	O
with	O
translation	B-Algorithm
that	O
is	O
not	O
purely	O
in	O
the	O
direction	O
of	O
scaling	B-Algorithm
;	O
taking	O
"	O
scaling	B-Algorithm
"	O
in	O
a	O
generalized	O
sense	O
it	O
includes	O
the	O
cases	O
that	O
the	O
scale	B-Algorithm
factor	O
is	O
zero	O
(	O
projection	B-Algorithm
)	O
or	O
negative	O
;	O
the	O
latter	O
includes	O
reflection	B-Algorithm
,	O
and	O
combined	O
with	O
translation	B-Algorithm
it	O
includes	O
glide	B-Algorithm
reflection	I-Algorithm
,	O
</s>
<s>
rotation	B-General_Concept
combined	O
with	O
a	O
homothety	B-Algorithm
and	O
a	O
translation	B-Algorithm
,	O
</s>
<s>
squeeze	O
mapping	O
combined	O
with	O
a	O
homothety	B-Algorithm
and	O
a	O
translation	B-Algorithm
.	O
</s>
<s>
To	O
visualise	O
the	O
general	O
affine	B-Algorithm
transformation	I-Algorithm
of	O
the	O
Euclidean	O
plane	O
,	O
take	O
labelled	O
parallelograms	O
ABCD	O
and	O
A′B′C′D′	O
.	O
</s>
<s>
Whatever	O
the	O
choices	O
of	O
points	O
,	O
there	O
is	O
an	O
affine	B-Algorithm
transformation	I-Algorithm
T	O
of	O
the	O
plane	O
taking	O
A	O
to	O
A′	O
,	O
and	O
each	O
vertex	O
similarly	O
.	O
</s>
<s>
Supposing	O
we	O
exclude	O
the	O
degenerate	O
case	O
where	O
ABCD	O
has	O
zero	O
area	O
,	O
there	O
is	O
a	O
unique	O
such	O
affine	B-Algorithm
transformation	I-Algorithm
T	O
.	O
Drawing	O
out	O
a	O
whole	O
grid	O
of	O
parallelograms	O
based	O
on	O
ABCD	O
,	O
the	O
image	O
T(P )	O
of	O
any	O
point	O
P	O
is	O
determined	O
by	O
noting	O
that	O
T(A )	O
=	O
A′	O
,	O
T	O
applied	O
to	O
the	O
line	O
segment	O
AB	O
is	O
A′B′	O
,	O
T	O
applied	O
to	O
the	O
line	O
segment	O
AC	O
is	O
A′C′	O
,	O
and	O
T	O
respects	O
scalar	O
multiples	O
of	O
vectors	O
based	O
at	O
A	O
.	O
</s>
<s>
The	O
functions	O
with	O
and	O
in	O
and	O
,	O
are	O
precisely	O
the	O
affine	B-Algorithm
transformations	I-Algorithm
of	O
the	O
real	O
line	O
.	O
</s>
<s>
This	O
transformation	O
skews	O
and	O
translates	B-Algorithm
the	O
original	O
triangle	O
.	O
</s>
<s>
In	O
fact	O
,	O
all	O
triangles	O
are	O
related	O
to	O
one	O
another	O
by	O
affine	B-Algorithm
transformations	I-Algorithm
.	O
</s>
