<s>
In	O
linear	B-Language
algebra	I-Language
,	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
,	O
or	O
orthonormal	B-Algorithm
matrix	I-Algorithm
,	O
is	O
a	O
real	B-Algorithm
square	I-Algorithm
matrix	I-Algorithm
whose	O
columns	O
and	O
rows	O
are	O
orthonormal	B-Algorithm
vectors	I-Algorithm
.	O
</s>
<s>
where	O
is	O
the	O
transpose	O
of	O
and	O
is	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
An	O
orthogonal	B-Algorithm
matrix	I-Algorithm
is	O
necessarily	O
invertible	O
(	O
with	O
inverse	O
)	O
,	O
unitary	B-Algorithm
(	O
)	O
,	O
where	O
is	O
the	O
Hermitian	O
adjoint	O
(	O
conjugate	B-Algorithm
transpose	I-Algorithm
)	O
of	O
,	O
and	O
therefore	O
normal	B-Algorithm
(	O
)	O
over	O
the	O
real	O
numbers	O
.	O
</s>
<s>
The	O
determinant	O
of	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
is	O
either	O
+1	O
or	O
−1	O
.	O
</s>
<s>
As	O
a	O
linear	B-Architecture
transformation	I-Architecture
,	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
preserves	O
the	O
inner	O
product	O
of	O
vectors	O
,	O
and	O
therefore	O
acts	O
as	O
an	O
isometry	O
of	O
Euclidean	O
space	O
,	O
such	O
as	O
a	O
rotation	B-General_Concept
,	O
reflection	B-Algorithm
or	O
rotoreflection	B-Algorithm
.	O
</s>
<s>
In	O
other	O
words	O
,	O
it	O
is	O
a	O
unitary	B-Algorithm
transformation	I-Algorithm
.	O
</s>
<s>
The	O
set	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
,	O
under	O
multiplication	O
,	O
forms	O
the	O
group	O
,	O
known	O
as	O
the	O
orthogonal	O
group	O
.	O
</s>
<s>
The	O
subgroup	O
consisting	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
with	O
determinant	O
+1	O
is	O
called	O
the	O
special	O
orthogonal	O
group	O
,	O
and	O
each	O
of	O
its	O
elements	O
is	O
a	O
special	B-Algorithm
orthogonal	I-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
As	O
a	O
linear	B-Architecture
transformation	I-Architecture
,	O
every	O
special	B-Algorithm
orthogonal	I-Algorithm
matrix	I-Algorithm
acts	O
as	O
a	O
rotation	B-General_Concept
.	O
</s>
<s>
An	O
orthogonal	B-Algorithm
matrix	I-Algorithm
is	O
the	O
real	O
specialization	O
of	O
a	O
unitary	B-Algorithm
matrix	I-Algorithm
,	O
and	O
thus	O
always	O
a	O
normal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
However	O
,	O
orthogonal	B-Algorithm
matrices	I-Algorithm
arise	O
naturally	O
from	O
dot	O
products	O
,	O
and	O
for	O
matrices	O
of	O
complex	O
numbers	O
that	O
leads	O
instead	O
to	O
the	O
unitary	B-Algorithm
requirement	O
.	O
</s>
<s>
where	O
is	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Written	O
with	O
respect	O
to	O
an	O
orthonormal	B-Algorithm
basis	O
,	O
the	O
squared	O
length	O
of	O
is	O
.	O
</s>
<s>
Thus	O
finite-dimensional	O
linear	O
isometries	O
—	O
rotations	O
,	O
reflections	O
,	O
and	O
their	O
combinations	O
—	O
produce	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
The	O
converse	O
is	O
also	O
true	O
:	O
orthogonal	B-Algorithm
matrices	I-Algorithm
imply	O
orthogonal	O
transformations	O
.	O
</s>
<s>
However	O
,	O
linear	B-Language
algebra	I-Language
includes	O
orthogonal	O
transformations	O
between	O
spaces	O
which	O
may	O
be	O
neither	O
finite-dimensional	O
nor	O
of	O
the	O
same	O
dimension	O
,	O
and	O
these	O
have	O
no	O
orthogonal	B-Algorithm
matrix	I-Algorithm
equivalent	O
.	O
</s>
<s>
Orthogonal	B-Algorithm
matrices	I-Algorithm
are	O
important	O
for	O
a	O
number	O
of	O
reasons	O
,	O
both	O
theoretical	O
and	O
practical	O
.	O
</s>
<s>
The	O
orthogonal	B-Algorithm
matrices	I-Algorithm
form	O
a	O
group	O
under	O
matrix	O
multiplication	O
,	O
the	O
orthogonal	O
group	O
denoted	O
by	O
,	O
which	O
—	O
with	O
its	O
subgroups	O
—	O
is	O
widely	O
used	O
in	O
mathematics	O
and	O
the	O
physical	O
sciences	O
.	O
</s>
<s>
Because	O
floating	O
point	O
versions	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
have	O
advantageous	O
properties	O
,	O
they	O
are	O
key	O
to	O
many	O
algorithms	O
in	O
numerical	O
linear	B-Language
algebra	I-Language
,	O
such	O
as	O
decomposition	O
.	O
</s>
<s>
As	O
another	O
example	O
,	O
with	O
appropriate	O
normalization	O
the	O
discrete	B-General_Concept
cosine	I-General_Concept
transform	I-General_Concept
(	O
used	O
in	O
MP3	B-Application
compression	O
)	O
is	O
represented	O
by	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Below	O
are	O
a	O
few	O
examples	O
of	O
small	O
orthogonal	B-Algorithm
matrices	I-Algorithm
and	O
possible	O
interpretations	O
.	O
</s>
<s>
The	O
simplest	O
orthogonal	B-Algorithm
matrices	I-Algorithm
are	O
the	O
matrices	O
 [ 1 ] 	O
and	O
[−1],	O
which	O
we	O
can	O
interpret	O
as	O
the	O
identity	O
and	O
a	O
reflection	B-Algorithm
of	O
the	O
real	O
line	O
across	O
the	O
origin	O
.	O
</s>
<s>
We	O
can	O
interpret	O
the	O
first	O
case	O
as	O
a	O
rotation	B-General_Concept
by	O
(	O
where	O
is	O
the	O
identity	O
)	O
,	O
and	O
the	O
second	O
as	O
a	O
reflection	B-Algorithm
across	O
a	O
line	O
at	O
an	O
angle	O
of	O
.	O
</s>
<s>
The	O
special	O
case	O
of	O
the	O
reflection	B-Algorithm
matrix	O
with	O
generates	O
a	O
reflection	B-Algorithm
about	O
the	O
line	O
at	O
45°	O
given	O
by	O
and	O
therefore	O
exchanges	O
and	O
;	O
it	O
is	O
a	O
permutation	B-Algorithm
matrix	I-Algorithm
,	O
with	O
a	O
single	O
1	O
in	O
each	O
column	O
and	O
row	O
(	O
and	O
otherwise	O
0	O
)	O
:	O
</s>
<s>
The	O
identity	O
is	O
also	O
a	O
permutation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
A	O
reflection	B-Algorithm
is	O
its	B-Algorithm
own	I-Algorithm
inverse	I-Algorithm
,	O
which	O
implies	O
that	O
a	O
reflection	B-Algorithm
matrix	O
is	O
symmetric	B-Algorithm
(	O
equal	O
to	O
its	O
transpose	O
)	O
as	O
well	O
as	O
orthogonal	O
.	O
</s>
<s>
The	O
product	O
of	O
two	O
rotation	B-Algorithm
matrices	I-Algorithm
is	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
,	O
and	O
the	O
product	O
of	O
two	O
reflection	B-Algorithm
matrices	O
is	O
also	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Regardless	O
of	O
the	O
dimension	O
,	O
it	O
is	O
always	O
possible	O
to	O
classify	O
orthogonal	B-Algorithm
matrices	I-Algorithm
as	O
purely	O
rotational	O
or	O
not	O
,	O
but	O
for	O
matrices	O
and	O
larger	O
the	O
non-rotational	O
matrices	O
can	O
be	O
more	O
complicated	O
than	O
reflections	O
.	O
</s>
<s>
represent	O
an	O
inversion	B-Algorithm
through	O
the	O
origin	O
and	O
a	O
rotoinversion	B-Algorithm
,	O
respectively	O
,	O
about	O
the	O
-axis	O
.	O
</s>
<s>
It	O
is	O
common	O
to	O
describe	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
in	O
terms	O
of	O
an	O
axis	O
and	O
angle	O
,	O
but	O
this	O
only	O
works	O
in	O
three	O
dimensions	O
.	O
</s>
<s>
Above	O
three	O
dimensions	O
two	O
or	O
more	O
angles	O
are	O
needed	O
,	O
each	O
associated	O
with	O
a	O
plane	O
of	O
rotation	B-General_Concept
.	O
</s>
<s>
The	O
most	O
elementary	O
permutation	O
is	O
a	O
transposition	O
,	O
obtained	O
from	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
by	O
exchanging	O
two	O
rows	O
.	O
</s>
<s>
Any	O
permutation	B-Algorithm
matrix	I-Algorithm
can	O
be	O
constructed	O
as	O
a	O
product	O
of	O
no	O
more	O
than	O
transpositions	O
.	O
</s>
<s>
Here	O
the	O
numerator	O
is	O
a	O
symmetric	B-Algorithm
matrix	I-Algorithm
while	O
the	O
denominator	O
is	O
a	O
number	O
,	O
the	O
squared	O
magnitude	O
of	O
.	O
</s>
<s>
This	O
is	O
a	O
reflection	B-Algorithm
in	O
the	O
hyperplane	O
perpendicular	O
to	O
(	O
negating	O
any	O
vector	O
component	O
parallel	O
to	O
)	O
.	O
</s>
<s>
A	O
Householder	B-Algorithm
reflection	I-Algorithm
is	O
typically	O
used	O
to	O
simultaneously	O
zero	O
the	O
lower	O
part	O
of	O
a	O
column	O
.	O
</s>
<s>
Any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
of	O
size	O
can	O
be	O
constructed	O
as	O
a	O
product	O
of	O
at	O
most	O
such	O
reflections	O
.	O
</s>
<s>
A	O
Givens	O
rotation	B-General_Concept
acts	O
on	O
a	O
two-dimensional	O
(	O
planar	O
)	O
subspace	O
spanned	O
by	O
two	O
coordinate	O
axes	O
,	O
rotating	O
by	O
a	O
chosen	O
angle	O
.	O
</s>
<s>
Any	O
rotation	B-Algorithm
matrix	I-Algorithm
of	O
size	O
can	O
be	O
constructed	O
as	O
a	O
product	O
of	O
at	O
most	O
such	O
rotations	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
matrices	O
,	O
three	O
such	O
rotations	O
suffice	O
;	O
and	O
by	O
fixing	O
the	O
sequence	O
we	O
can	O
thus	O
describe	O
all	O
rotation	B-Algorithm
matrices	I-Algorithm
(	O
though	O
not	O
uniquely	O
)	O
in	O
terms	O
of	O
the	O
three	O
angles	O
used	O
,	O
often	O
called	O
Euler	O
angles	O
.	O
</s>
<s>
A	O
Jacobi	O
rotation	B-General_Concept
has	O
the	O
same	O
form	O
as	O
a	O
Givens	O
rotation	B-General_Concept
,	O
but	O
is	O
used	O
to	O
zero	O
both	O
off-diagonal	O
entries	O
of	O
a	O
symmetric	B-Algorithm
submatrix	O
.	O
</s>
<s>
A	O
real	B-Algorithm
square	I-Algorithm
matrix	I-Algorithm
is	O
orthogonal	O
if	O
and	O
only	O
if	O
its	O
columns	O
form	O
an	O
orthonormal	B-Algorithm
basis	O
of	O
the	O
Euclidean	O
space	O
with	O
the	O
ordinary	O
Euclidean	O
dot	O
product	O
,	O
which	O
is	O
the	O
case	O
if	O
and	O
only	O
if	O
its	O
rows	O
form	O
an	O
orthonormal	B-Algorithm
basis	O
of	O
.	O
</s>
<s>
It	O
might	O
be	O
tempting	O
to	O
suppose	O
a	O
matrix	O
with	O
orthogonal	O
(	O
not	O
orthonormal	B-Algorithm
)	O
columns	O
would	O
be	O
called	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
,	O
but	O
such	O
matrices	O
have	O
no	O
special	O
interest	O
and	O
no	O
special	O
name	O
;	O
they	O
only	O
satisfy	O
,	O
with	O
a	O
diagonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
The	O
determinant	O
of	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
is	O
+1	O
or	O
−1	O
.	O
</s>
<s>
With	O
permutation	B-Algorithm
matrices	I-Algorithm
the	O
determinant	O
matches	O
the	O
signature	O
,	O
being	O
+1	O
or	O
−1	O
as	O
the	O
parity	O
of	O
the	O
permutation	O
is	O
even	O
or	O
odd	O
,	O
for	O
the	O
determinant	O
is	O
an	O
alternating	O
function	O
of	O
the	O
rows	O
.	O
</s>
<s>
Stronger	O
than	O
the	O
determinant	O
restriction	O
is	O
the	O
fact	O
that	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
can	O
always	O
be	O
diagonalized	B-Algorithm
over	O
the	O
complex	O
numbers	O
to	O
exhibit	O
a	O
full	O
set	O
of	O
eigenvalues	O
,	O
all	O
of	O
which	O
must	O
have	O
(	O
complex	O
)	O
modulus1	O
.	O
</s>
<s>
The	O
inverse	O
of	O
every	O
orthogonal	B-Algorithm
matrix	I-Algorithm
is	O
again	O
orthogonal	O
,	O
as	O
is	O
the	O
matrix	O
product	O
of	O
two	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
In	O
fact	O
,	O
the	O
set	O
of	O
all	O
orthogonal	B-Algorithm
matrices	I-Algorithm
satisfies	O
all	O
the	O
axioms	O
of	O
a	O
group	O
.	O
</s>
<s>
The	O
orthogonal	B-Algorithm
matrices	I-Algorithm
whose	O
determinant	O
is	O
+1	O
form	O
a	O
path-connected	O
normal	B-Algorithm
subgroup	O
of	O
of	O
index	O
2	O
,	O
the	O
special	O
orthogonal	O
group	O
of	O
rotations	O
.	O
</s>
<s>
Orthogonal	B-Algorithm
matrices	I-Algorithm
with	O
determinant	O
−1	O
do	O
not	O
include	O
the	O
identity	O
,	O
and	O
so	O
do	O
not	O
form	O
a	O
subgroup	O
but	O
only	O
a	O
coset	O
;	O
it	O
is	O
also	O
(	O
separately	O
)	O
connected	O
.	O
</s>
<s>
In	O
practical	O
terms	O
,	O
a	O
comparable	O
statement	O
is	O
that	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
can	O
be	O
produced	O
by	O
taking	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
and	O
possibly	O
negating	O
one	O
of	O
its	O
columns	O
,	O
as	O
we	O
saw	O
with	O
matrices	O
.	O
</s>
<s>
If	O
is	O
odd	O
,	O
then	O
the	O
semidirect	O
product	O
is	O
in	O
fact	O
a	O
direct	O
product	O
,	O
and	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
can	O
be	O
produced	O
by	O
taking	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
and	O
possibly	O
negating	O
all	O
of	O
its	O
columns	O
.	O
</s>
<s>
Now	O
consider	O
orthogonal	B-Algorithm
matrices	I-Algorithm
with	O
bottom	O
right	O
entry	O
equal	O
to	O
1	O
.	O
</s>
<s>
The	O
rest	O
of	O
the	O
matrix	O
is	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
;	O
thus	O
is	O
a	O
subgroup	O
of	O
(	O
and	O
of	O
all	O
higher	O
groups	O
)	O
.	O
</s>
<s>
Since	O
an	O
elementary	O
reflection	B-Algorithm
in	O
the	O
form	O
of	O
a	O
Householder	B-Algorithm
matrix	I-Algorithm
can	O
reduce	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
to	O
this	O
constrained	O
form	O
,	O
a	O
series	O
of	O
such	O
reflections	O
can	O
bring	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
to	O
the	O
identity	O
;	O
thus	O
an	O
orthogonal	O
group	O
is	O
a	O
reflection	B-Algorithm
group	I-Algorithm
.	O
</s>
<s>
Similarly	O
,	O
is	O
a	O
subgroup	O
of	O
;	O
and	O
any	O
special	B-Algorithm
orthogonal	I-Algorithm
matrix	I-Algorithm
can	O
be	O
generated	O
by	O
Givens	O
plane	O
rotations	O
using	O
an	O
analogous	O
procedure	O
.	O
</s>
<s>
A	O
single	O
rotation	B-General_Concept
can	O
produce	O
a	O
zero	O
in	O
the	O
first	O
row	O
of	O
the	O
last	O
column	O
,	O
and	O
series	O
of	O
rotations	O
will	O
zero	O
all	O
but	O
the	O
last	O
row	O
of	O
the	O
last	O
column	O
of	O
an	O
rotation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Since	O
the	O
planes	O
are	O
fixed	O
,	O
each	O
rotation	B-General_Concept
has	O
only	O
one	O
degree	O
of	O
freedom	O
,	O
its	O
angle	O
.	O
</s>
<s>
Permutation	B-Algorithm
matrices	I-Algorithm
are	O
simpler	O
still	O
;	O
they	O
form	O
,	O
not	O
a	O
Lie	O
group	O
,	O
but	O
only	O
a	O
finite	O
group	O
,	O
the	O
order	O
symmetric	B-Algorithm
group	I-Algorithm
.	O
</s>
<s>
The	O
even	O
permutations	O
produce	O
the	O
subgroup	O
of	O
permutation	B-Algorithm
matrices	I-Algorithm
of	O
determinant	O
+1	O
,	O
the	O
order	O
alternating	B-Algorithm
group	I-Algorithm
.	O
</s>
<s>
More	O
broadly	O
,	O
the	O
effect	O
of	O
any	O
orthogonal	B-Algorithm
matrix	I-Algorithm
separates	O
into	O
independent	O
actions	O
on	O
orthogonal	O
two-dimensional	O
subspaces	O
.	O
</s>
<s>
That	O
is	O
,	O
if	O
is	O
special	O
orthogonal	O
then	O
one	O
can	O
always	O
find	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
,	O
a	O
(	O
rotational	O
)	O
change	O
of	O
basis	O
,	O
that	O
brings	O
into	O
block	O
diagonal	O
form	O
:	O
</s>
<s>
where	O
the	O
matrices	O
are	O
rotation	B-Algorithm
matrices	I-Algorithm
,	O
and	O
with	O
the	O
remaining	O
entries	O
zero	O
.	O
</s>
<s>
Exceptionally	O
,	O
a	O
rotation	B-General_Concept
block	O
may	O
be	O
diagonal	O
,	O
.	O
</s>
<s>
If	O
is	O
odd	O
,	O
there	O
is	O
at	O
least	O
one	O
real	O
eigenvalue	O
,	O
+1	O
or	O
−1	O
;	O
for	O
a	O
rotation	B-General_Concept
,	O
the	O
eigenvector	O
associated	O
with	O
+1	O
is	O
the	O
rotation	B-General_Concept
axis	O
.	O
</s>
<s>
In	O
Lie	O
group	O
terms	O
,	O
this	O
means	O
that	O
the	O
Lie	O
algebra	O
of	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
group	O
consists	O
of	O
skew-symmetric	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
Going	O
the	O
other	O
direction	O
,	O
the	O
matrix	O
exponential	O
of	O
any	O
skew-symmetric	B-Algorithm
matrix	I-Algorithm
is	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
(	O
in	O
fact	O
,	O
special	O
orthogonal	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
three-dimensional	O
object	O
physics	O
calls	O
angular	O
velocity	O
is	O
a	O
differential	O
rotation	B-General_Concept
,	O
thus	O
a	O
vector	O
in	O
the	O
Lie	O
algebra	O
tangent	O
to	O
.	O
</s>
<s>
The	O
exponential	O
of	O
this	O
is	O
the	O
orthogonal	B-Algorithm
matrix	I-Algorithm
for	O
rotation	B-General_Concept
around	O
axis	O
by	O
angle	O
;	O
setting	O
,	O
,	O
</s>
<s>
Numerical	B-General_Concept
analysis	I-General_Concept
takes	O
advantage	O
of	O
many	O
of	O
the	O
properties	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
for	O
numerical	O
linear	B-Language
algebra	I-Language
,	O
and	O
they	O
arise	O
naturally	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
is	O
often	O
desirable	O
to	O
compute	O
an	O
orthonormal	B-Algorithm
basis	O
for	O
a	O
space	O
,	O
or	O
an	O
orthogonal	O
change	O
of	O
bases	O
;	O
both	O
take	O
the	O
form	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
Having	O
determinant	O
±1	O
and	O
all	O
eigenvalues	O
of	O
magnitude	O
1	O
is	O
of	O
great	O
benefit	O
for	O
numeric	B-Algorithm
stability	I-Algorithm
.	O
</s>
<s>
One	O
implication	O
is	O
that	O
the	O
condition	B-Algorithm
number	I-Algorithm
is	O
1	O
(	O
which	O
is	O
the	O
minimum	O
)	O
,	O
so	O
errors	O
are	O
not	O
magnified	O
when	O
multiplying	O
with	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Many	O
algorithms	O
use	O
orthogonal	B-Algorithm
matrices	I-Algorithm
like	O
Householder	B-Algorithm
reflections	I-Algorithm
and	O
Givens	O
rotations	O
for	O
this	O
reason	O
.	O
</s>
<s>
It	O
is	O
also	O
helpful	O
that	O
,	O
not	O
only	O
is	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
invertible	O
,	O
but	O
its	O
inverse	O
is	O
available	O
essentially	O
free	O
,	O
by	O
exchanging	O
indices	O
.	O
</s>
<s>
Permutations	O
are	O
essential	O
to	O
the	O
success	O
of	O
many	O
algorithms	O
,	O
including	O
the	O
workhorse	O
Gaussian	B-Algorithm
elimination	I-Algorithm
with	O
partial	O
pivoting	O
(	O
where	O
permutations	O
do	O
the	O
pivoting	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
Givens	O
rotation	B-General_Concept
affects	O
only	O
two	O
rows	O
of	O
a	O
matrix	O
it	O
multiplies	O
,	O
changing	O
a	O
full	O
multiplication	O
of	O
order	O
to	O
a	O
much	O
more	O
efficient	O
order	O
.	O
</s>
<s>
(	O
Following	O
,	O
we	O
do	O
not	O
store	O
a	O
rotation	B-General_Concept
angle	O
,	O
which	O
is	O
both	O
expensive	O
and	O
badly	O
behaved	O
.	O
)	O
</s>
<s>
A	O
number	O
of	O
important	O
matrix	O
decompositions	O
involve	O
orthogonal	B-Algorithm
matrices	I-Algorithm
,	O
including	O
especially	O
:	O
</s>
<s>
The	O
linear	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
problem	O
is	O
to	O
find	O
the	O
that	O
minimizes	O
,	O
which	O
is	O
equivalent	O
to	O
projecting	O
to	O
the	O
subspace	O
spanned	O
by	O
the	O
columns	O
of	O
.	O
</s>
<s>
But	O
the	O
lower	O
rows	O
of	O
zeros	O
in	O
are	O
superfluous	O
in	O
the	O
product	O
,	O
which	O
is	O
thus	O
already	O
in	O
lower-triangular	O
upper-triangular	O
factored	O
form	O
,	O
as	O
in	O
Gaussian	B-Algorithm
elimination	I-Algorithm
(	O
Cholesky	O
decomposition	O
)	O
.	O
</s>
<s>
With	O
factored	O
as	O
,	O
a	O
satisfactory	O
solution	O
uses	O
the	O
Moore-Penrose	O
pseudoinverse	B-Algorithm
,	O
,	O
where	O
merely	O
replaces	O
each	O
non-zero	O
diagonal	O
entry	O
with	O
its	O
reciprocal	O
.	O
</s>
<s>
Suppose	O
,	O
for	O
example	O
,	O
that	O
is	O
a	O
rotation	B-Algorithm
matrix	I-Algorithm
which	O
has	O
been	O
computed	O
as	O
the	O
composition	O
of	O
numerous	O
twists	O
and	O
turns	O
.	O
</s>
<s>
A	O
Gram	B-Algorithm
–	I-Algorithm
Schmidt	I-Algorithm
process	I-Algorithm
could	O
orthogonalize	O
the	O
columns	O
,	O
but	O
it	O
is	O
not	O
the	O
most	O
reliable	O
,	O
nor	O
the	O
most	O
efficient	O
,	O
nor	O
the	O
most	O
invariant	O
method	O
.	O
</s>
<s>
The	O
polar	O
decomposition	O
factors	O
a	O
matrix	O
into	O
a	O
pair	O
,	O
one	O
of	O
which	O
is	O
the	O
unique	O
closest	O
orthogonal	B-Algorithm
matrix	I-Algorithm
to	O
the	O
given	O
matrix	O
,	O
or	O
one	O
of	O
the	O
closest	O
if	O
the	O
given	O
matrix	O
is	O
singular	O
.	O
</s>
<s>
Gram-Schmidt	B-Algorithm
yields	O
an	O
inferior	O
solution	O
,	O
shown	O
by	O
a	O
Frobenius	O
distance	O
of	O
8.28659	O
instead	O
of	O
the	O
minimum	O
8.12404	O
.	O
</s>
<s>
Some	O
numerical	O
applications	O
,	O
such	O
as	O
Monte	B-Algorithm
Carlo	I-Algorithm
methods	I-Algorithm
and	O
exploration	O
of	O
high-dimensional	O
data	O
spaces	O
,	O
require	O
generation	O
of	O
uniformly	O
distributed	O
random	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
In	O
this	O
context	O
,	O
"	O
uniform	O
"	O
is	O
defined	O
in	O
terms	O
of	O
Haar	O
measure	O
,	O
which	O
essentially	O
requires	O
that	O
the	O
distribution	O
not	O
change	O
if	O
multiplied	O
by	O
any	O
freely	O
chosen	O
orthogonal	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Orthogonalizing	O
matrices	O
with	O
independent	O
uniformly	O
distributed	O
random	O
entries	O
does	O
not	O
result	O
in	O
uniformly	O
distributed	O
orthogonal	B-Algorithm
matrices	I-Algorithm
,	O
but	O
the	O
decomposition	O
of	O
independent	O
normally	O
distributed	O
random	O
entries	O
does	O
,	O
as	O
long	O
as	O
the	O
diagonal	O
of	O
contains	O
only	O
positive	O
entries	O
.	O
</s>
<s>
To	O
generate	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
,	O
take	O
an	O
one	O
and	O
a	O
uniformly	O
distributed	O
unit	O
vector	O
of	O
dimension	O
.	O
</s>
<s>
Construct	O
a	O
Householder	B-Algorithm
reflection	I-Algorithm
from	O
the	O
vector	O
,	O
then	O
apply	O
it	O
to	O
the	O
smaller	O
matrix	O
(	O
embedded	O
in	O
the	O
larger	O
size	O
with	O
a	O
1	O
at	O
the	O
bottom	O
right	O
corner	O
)	O
.	O
</s>
<s>
The	O
problem	O
of	O
finding	O
the	O
orthogonal	B-Algorithm
matrix	I-Algorithm
nearest	O
a	O
given	O
matrix	O
is	O
related	O
to	O
the	O
Orthogonal	O
Procrustes	O
problem	O
.	O
</s>
<s>
This	O
may	O
be	O
combined	O
with	O
the	O
Babylonian	O
method	O
for	O
extracting	O
the	O
square	O
root	O
of	O
a	O
matrix	O
to	O
give	O
a	O
recurrence	O
which	O
converges	O
to	O
an	O
orthogonal	B-Algorithm
matrix	I-Algorithm
quadratically	O
:	O
</s>
<s>
These	O
iterations	O
are	O
stable	O
provided	O
the	O
condition	B-Algorithm
number	I-Algorithm
of	O
is	O
less	O
than	O
three	O
.	O
</s>
<s>
A	O
subtle	O
technical	O
problem	O
afflicts	O
some	O
uses	O
of	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
The	O
Pin	O
and	O
Spin	O
groups	O
are	O
found	O
within	O
Clifford	O
algebras	O
,	O
which	O
themselves	O
can	O
be	O
built	O
from	O
orthogonal	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
If	O
is	O
not	O
a	O
square	B-Algorithm
matrix	I-Algorithm
,	O
then	O
the	O
conditions	O
and	O
are	O
not	O
equivalent	O
.	O
</s>
<s>
The	O
condition	O
says	O
that	O
the	O
columns	O
of	O
Q	O
are	O
orthonormal	B-Algorithm
.	O
</s>
<s>
Similarly	O
,	O
says	O
that	O
the	O
rows	O
of	O
are	O
orthonormal	B-Algorithm
,	O
which	O
requires	O
.	O
</s>
<s>
They	O
are	O
variously	O
called	O
"	O
semi-orthogonal	O
matrices	O
"	O
,	O
"	O
orthonormal	B-Algorithm
matrices	O
"	O
,	O
"	O
orthogonal	B-Algorithm
matrices	I-Algorithm
"	O
,	O
and	O
sometimes	O
simply	O
"	O
matrices	O
with	O
orthonormal	B-Algorithm
rows/columns	O
"	O
.	O
</s>
<s>
For	O
the	O
case	O
,	O
matrices	O
with	O
orthonormal	B-Algorithm
columns	O
may	O
be	O
referred	O
to	O
as	O
orthogonal	O
k-frames	O
and	O
they	O
are	O
elements	O
of	O
the	O
Stiefel	O
manifold	O
.	O
</s>
