Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reflection of a Vector
#2
The dot product should only produce a scalar, if you have W * W^T then W should be a 1x3 matrix, whereas W^T * W would use the 3x1 matrix. Both of those are W dot W; you transpose the one that makes sense.

Your projection function is just wrong; it should be (a dot b) * b / ||b||^2 to project a onto b. (note: this will produce a vector the same dimension as b, since (a dot b) is a scalar and so is ||b||)

In this case if you were projecting a=(2,1,2)' onto b=(1,1,1)'
so (a dot b) = 5, ||b||^2 = 3
5/3*(1,1,1)'
(not gonna do the actual question for you)


Actually that's another point. ||b||^2 is b dot b.
The 2-norm is sqrt(v_1^2+v_2^2+...+v_n^2), the square root of the sum of squares of each component. So squaring it you get ||v||^2 = v_1^2 + v_2^2 + ...
Which for ||(1,1,1)||^2 = 1^2 + 1^2 + 1^2 = 3 = (1,1,1) dot (1,1,1)
Reply


Messages In This Thread
Reflection of a Vector - by Tay - 2014-02-01, 04:01 AM
Reflection of a Vector - by Stereo - 2014-02-01, 03:20 PM
Reflection of a Vector - by Tay - 2014-02-01, 07:25 PM
Reflection of a Vector - by Stereo - 2014-02-01, 11:09 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)