(
c
s
−
s
c
)
T
(
a
b
)
=
(
r
0
)
{\displaystyle {\begin{pmatrix}c&s\\-s&c\\\end{pmatrix}}^{T}{\begin{pmatrix}a&b\\\end{pmatrix}}={\begin{pmatrix}r&0\\\end{pmatrix}}}
r
=
a
2
+
b
2
,
{\displaystyle r={\sqrt {a^{2}+b^{2}}},}
c
=
a
a
2
+
b
2
,
s
=
b
a
2
+
b
2
{\displaystyle c={{a} \over {\sqrt {a^{2}+b^{2}}}}\;\;,\;\;s={{b} \over {\sqrt {a^{2}+b^{2}}}}}
A
1
=
[
6
5
0
5
1
4
0
4
3
]
{\displaystyle A_{1}={\begin{bmatrix}6&5&0\\5&1&4\\0&4&3\\\end{bmatrix}}}
기븐스 회전의 두번 반복 (여기서는
3
{\displaystyle 3}
행
3
{\displaystyle 3}
열의 성분이 이미
0
{\displaystyle 0}
이다)을 수행하여 QR 분해 를 계산하기위한 상삼각행렬 을 산출한다.
필요한 행렬을 만들기 위해서는 성분
(
2
,
1
)
{\displaystyle (2,1)}
과
(
3
,
2
)
{\displaystyle (3,2)}
를 제로화해야한다. 먼저 성분
(
2
,
1
)
{\displaystyle (2,1)}
를
0
{\displaystyle 0}
으로 선택하여,
회전 행렬을 적용하면,
G
1
=
[
c
−
s
0
s
c
0
0
0
1
]
{\displaystyle G_{1}={\begin{bmatrix}c&-s&0\\s&c&0\\0&0&1\\\end{bmatrix}}}
G
1
A
1
=
A
2
=
[
c
−
s
0
s
c
0
0
0
1
]
[
6
5
0
5
1
4
0
4
3
]
{\displaystyle {\begin{aligned}G_{1}A_{1}&{}=A_{2}\\&{}={\begin{bmatrix}c&-s&0\\s&c&0\\0&0&1\\\end{bmatrix}}{\begin{bmatrix}6&5&0\\5&1&4\\0&4&3\\\end{bmatrix}}\end{aligned}}}
r
=
6
2
+
5
2
≈
7.8102
{\displaystyle r={\sqrt {6^{2}+5^{2}}}\approx 7.8102}
c
=
6
/
r
≈
0.7682
{\displaystyle c=6/r\approx 0.7682}
s
=
−
5
/
r
≈
−
0.6402
{\displaystyle s=-5/r\approx -0.6402}
A
2
≈
[
7.8102
4.4813
2.5607
0
−
2.4327
3.0729
0
4
3
]
{\displaystyle A_{2}\approx {\begin{bmatrix}7.8102&4.4813&2.5607\\0&-2.4327&3.0729\\0&4&3\\\end{bmatrix}}}
이제 프로세스를 끝내기 위해
(
3
,
2
)
{\displaystyle (3,2)}
성분을 제로로 만든다. 이전과 같은 아이디어를 사용하여 회전 행렬을 적용한다.
G
2
=
[
1
0
0
0
c
−
s
0
s
c
]
{\displaystyle G_{2}={\begin{bmatrix}1&0&0\\0&c&-s\\0&s&c\\\end{bmatrix}}}
G
2
A
2
=
A
3
≈
[
1
0
0
0
c
−
s
0
s
c
]
[
7.8102
4.4813
2.5607
0
−
2.4327
3.0729
0
4
3
]
{\displaystyle {\begin{aligned}G_{2}A_{2}&{}=A_{3}\\&{}\approx {\begin{bmatrix}1&0&0\\0&c&-s\\0&s&c\\\end{bmatrix}}{\begin{bmatrix}7.8102&4.4813&2.5607\\0&-2.4327&3.0729\\0&4&3\\\end{bmatrix}}\end{aligned}}}
r
≈
(
−
2.4327
)
2
+
4
2
≈
4.6817
{\displaystyle r\approx {\sqrt {(-2.4327)^{2}+4^{2}}}\approx 4.6817}
c
≈
−
2.4327
/
r
≈
−
0.5196
{\displaystyle c\approx -2.4327/r\approx -0.5196}
s
≈
−
4
/
r
≈
−
0.8544
{\displaystyle s\approx -4/r\approx -0.8544}
A
3
≈
[
7.8102
4.4813
2.5607
0
4.6817
0.9664
0
0
−
4.1843
]
=
R
{\displaystyle A_{3}\approx {\begin{bmatrix}7.8102&4.4813&2.5607\\0&4.6817&0.9664\\0&0&-4.1843\\\end{bmatrix}}=R}
이 새로운 행렬
A
3
{\displaystyle A_{3}}
은 QR 분해 을 수행하는데 필요한 상삼각행렬
R
{\displaystyle R}
이다.
Q
{\displaystyle Q}
는 이제 다음과 같은 방식으로 회전 행렬의 전치 를 사용하여 형성된다.
Q
=
G
1
T
G
2
T
{\displaystyle Q=G_{1}^{T}\,G_{2}^{T}}
Q
≈
[
0.7682
0.3327
0.5470
0.6402
−
0.3992
−
0.6564
0
0.8544
−
0.5196
]
{\displaystyle Q\approx {\begin{bmatrix}0.7682&0.3327&0.5470\\0.6402&-0.3992&-0.6564\\0&0.8544&-0.5196\\\end{bmatrix}}}
Q
R
=
A
{\displaystyle QR=A}