;; Given a list G1, G2, G3, ... of vectors, we ; compute an orthogonal system ; B1, B2, B3, ... with the same span. ; ; In particular if G1, G2, G3, ... was a basis, ; then the B-system is an orthogonal basis. ; ; We could normalize the B-vectors, to get ; an ortho-normal basis N1, N2, N3, ... ; The dot-product w.r.t that ortho-normal basis will ; equal the abstract inner-product that we started with. % (use-ring Rational-ring) % (setq G1 (mat-make-initseq 3 1 '(1 0 0))) [ 1 ] [ 0 ] [ 0 ] % (setq G2 (mat-make-initseq 3 1 '(2 -3 0))) [ 2 ] [ -3 ] [ 0 ] % (setq G3 (mat-make-initseq 3 1 '(-1 2 4))) [ -1 ] [ 2 ] [ 4 ] ;; Computing an orthogonal {B1, B2, B3} with the ;; same span as {G1, G2, G3}. % (setq B1 G1) [ 1 ] [ 0 ] [ 0 ] % (setq ratio (/ (ip B1 G2) (ip B1 B1))) -> 2 % (setq ProjG2onB1 (mat-scal-mult ratio B1)) [ 2 ] [ 0 ] [ 0 ] % (setq B2 (mat-sub G2 ProjG2onB1)) ;;This is Orth_B1(G2). [ 0 ] [ -3 ] [ 0 ] % (ip B1 B2) -> 0 ; Checking the B-vectors are orthogonal. ;; Computing B3. % (setq ProjG3onB1 (mat-scal-mult (/ (ip B1 G3) (ip B1 B1)) B1) ) [ -1 ] [ 0 ] [ 0 ] % (setq ProjG3onB2 (mat-scal-mult (/ (ip B2 G3) (ip B2 B2)) B2) ) [ 0 ] [ 2 ] [ 0 ] % (setq B3 (mat-sub G3 (mat-add ProjG3onB1 ProjG3onB2))) [ 0 ] [ 0 ] [ 4 ] Easily [ -1 ] [ 0 ] [ 0 ] [ 0 ] , [ 2 ] , [ 0 ] [ 0 ] [ 0 ] [ 4 ] is an orthogonal basis for |R^3. ================