Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Problem 6.4 Number 5
- # Problem givens:
- b1 = [1; 1; 1]
- b2 = [-2; 1; 1]
- b3 = [0; 1; -1]
- d1 = b1/norm(b1)
- d2 = b2/norm(b2)
- d3 = b3/norm(b3)
- L(x) = [x[1]; x[2]; -x[3]]
- # Using formula from current section 6.4: $A_{ij} = \bk{d_i}{L(d_j)}$
- LD = [dot(d1, L(d1)) dot(d1, L(d2)) dot(d1, L(d3)); dot(d2, L(d1)) dot(d2, L(d2)) dot(d2, L(d3)); dot(d3, L(d1)) dot(d3, L(d2)) dot(d3, L(d3))]
- # Verification using older technique
- # conversion matrix from basis D to standard basis E
- PED = hcat(d1, d2, d3)
- # Matrix in standard basis is quite intuitive, just reverse x_3 in three standard basis vectors.
- LE = [1 0 0; 0 1 0; 0 0 -1]
- LD2 = inv(PED) * LE * PED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement