グラム・シュミットの正規直交化法
u 1 := v 1 u 2 := v 2 − ( u 1 , v 2 ) ( u 1 , u 1 ) u 1 u 3 := v 3 − ( u 1 , v 3 ) ( u 1 , u 1 ) u 1 − ( u 2 , v 3 ) ( u 2 , u 2 ) u 2 ⋮ u n := v n − ( u 1 , v n ) ( u 1 , u 1 ) u 1 − ( u 2 , v n ) ( u 2 , u 2 ) u 2 − ⋯ − ( u n − 1 , v n ) ( u n − 1 , u n − 1 ) u n − 1 := v n − ∑ i = 1 n − 1 ( u i , v n ) ( u i , u i ) u i {\displaystyle {\begin{aligned}{\boldsymbol {u}}_{1}&:={\boldsymbol {v}}_{1}\\{\boldsymbol {u}}_{2}&:={\boldsymbol {v}}_{2}-{\frac {({\boldsymbol {u}}_{1},{\boldsymbol {v}}_{2})}{({\boldsymbol {u}}_{1},{\boldsymbol {u}}_{1})}}{\boldsymbol {u}}_{1}\\{\boldsymbol {u}}_{3}&:={\boldsymbol {v}}_{3}-{\frac {({\boldsymbol {u}}_{1},{\boldsymbol {v}}_{3})}{({\boldsymbol {u}}_{1},{\boldsymbol {u}}_{1})}}{\boldsymbol {u}}_{1}-{\frac {({\boldsymbol {u}}_{2},{\boldsymbol {v}}_{3})}{({\boldsymbol {u}}_{2},{\boldsymbol {u}}_{2})}}{\boldsymbol {u}}_{2}\\&\vdots \\{\boldsymbol {u}}_{n}&:={\boldsymbol {v}}_{n}-{\frac {({\boldsymbol {u}}_{1},{\boldsymbol {v}}_{n})}{({\boldsymbol {u}}_{1},{\boldsymbol {u}}_{1})}}{\boldsymbol {u}}_{1}-{\frac {({\boldsymbol {u}}_{2},{\boldsymbol {v}}_{n})}{({\boldsymbol {u}}_{2},{\boldsymbol {u}}_{2})}}{\boldsymbol {u}}_{2}-\dotsb -{\frac {({\boldsymbol {u}}_{n-1},{\boldsymbol {v}}_{n})}{({\boldsymbol {u}}_{n-1},{\boldsymbol {u}}_{n-1})}}{\boldsymbol {u}}_{n-1}\\&:={\boldsymbol {v}}_{n}-\textstyle \sum \limits _{i=1}^{n-1}{\dfrac {({\boldsymbol {u}}_{i},{\boldsymbol {v}}_{n})}{({\boldsymbol {u}}_{i},{\boldsymbol {u}}_{i})}}{\boldsymbol {u}}_{i}\end{aligned}}}