14Nov2023: (ip-select t) "Using COLVEC-inner-product." (setq u (mat-make-colvec 1 1 0)) [ 1 ] [ 1 ] [ 0 ] (setq v (mat-make-colvec 0 1 2)) (setq b (mat-make-colvec -1 2 3)) ;; Let L := Spn(u,v) and let ;; bOnL ;; be the ortho-projection of b onto plane L. ;; Is bOnL ;; just the sum of projections on u and v separately? ;; No! vectors u and v interact, as they are not a perpendicular pair. ;; So lets rewrite L as the span of a perpendicular pair. (proj v u) [ 1/2 ] [ 1/2 ] ; 1/2 [ 0 ] ;; So a vector in L that is perpendicular to u is: (setq vHat (mat-sub v (proj v u))) [ -1/2 ] [ 1/2 ] [ 2 ] (ip vHat u) => 0 ;; Yup. ;; Making vHat nicer. (setq vHat (mat-scal-mult 2 vHat)) [ -1 ] [ 1 ] [ 4 ] ;;;;;;;;;;;;;;;; ;; Now for the b projections. ;;;;;;;;;;;;;;;; (setq bProjOnu (proj b u)) [ 1/2 ] [ 1/2 ] [ 0 ] (setq bProjOnvHat (proj b vHat)) [ -5/6 ] [ 5/6 ] [ 10/3 ] ;; Drum roll, please... (setq bOnL (mat-add bProjOnu bProjOnvHat)) [ -1/3 ] [ 4/3 ] [ 10/3 ] ;;;;;;;;;;;;;;;; ;;Checking. First compute the supposed ;; orthogonal-to-L vector: ;;;;;;;;;;;;;;;; (setq bDiff (mat-sub b bOnL)) [ -2/3 ] [ 2/3 ] [ -1/3 ] (ip bDiff u) => 0 (ip bDiff v) => 0 ;; Now let's jeck that bOnL is indeed ;; in the L plane. (setq M (mat-Horiz-concat u v bOnL)) [ 1 0 -1/3 ] [ 1 1 4/3 ] [ 0 2 10/3 ] (rref-mtab-beforecol M) JK: Found 2 pivots before the third column. c0 c1 c2 Row operations |------------------| r0 | 1 0 -1/3 | 1 0 0 r1 | 0 1 5/3 | -1 1 0 r2 | 0 0 0 | 2 -2 1 |------------------| ;; Yup; The rightmost column is in the span ;; of the two columns to its left.