Given the formulas v1 = x ∥x∥2 and w2 = y − αv1, we can define v2 = w2 ∥w2∥2. We need to find the formula for α such that (v1, w2) = (v1, v2) = 0.
The dot product between v1 and w2 can be written as:
(v1, w2) = (x ||x||^2, y - αv1) = (x, y) ||x||^2 - α||x||^4
The dot product between v1 and v2 can be written as:
(v1, v2) = (x ||x||^2, w2 ||w2||^2) = (x, y - αv1) ||y - αv1||^2 = (x, y - αv1) (y - αv1) /||(y - αv1)||^2
We want (v1, w2) = (v1, v2) = 0. Therefore, we need to solve the system of equations:
(x, y) ||x||^2 - α||x||^4 = 0 (x, y - αv1) (y - αv1) = 0
If (x, y - αv1) = 0, then (v1, v2) is also 0. Therefore, α = (x, y)/||x||^2.
To obtain the unit orthogonal basis for the sub-space spanned by x and y, we simply normalize v1 and v2. The Matlab code for this is:
main.m542 chars22 lines
gistlibby LogSnag