<div class="gmail_quote">On Tue, Sep 14, 2010 at 6:37 PM, Moreland, Kenneth <span dir="ltr"><<a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size:11pt">You can get the magnitude squared of any vector by taking the dot product with itself. That’s basically what you are doing to compute the bSquared variable although I would suggest using vtkMath::Dot(b,b) instead.<br>
<br>
-Ken<div><div></div><div class="h5"></div></div></span></font></div></blockquote></div><br><div>Thanks John and Ken,</div><div><br>I changed it to use the dot product of b with itself instead of the squared norm. I also changed the function to return a bool. If b is a zero vector it returns false and 'projected' is invalid' (I put a note in the function description about this behavior). Otherwise, it computes the projection and returns true.</div>
<div><br></div><div>Here is the latest commit:</div><div><a href="http://github.com/daviddoria/daviddoria-vtk/commit/e227a729bbd8062c434894d23cc65f72213470c8">http://github.com/daviddoria/daviddoria-vtk/commit/e227a729bbd8062c434894d23cc65f72213470c8</a></div>
<div><a href="http://github.com/daviddoria/daviddoria-vtk/commit/e227a729bbd8062c434894d23cc65f72213470c8"></a><br clear="all">Thanks,<br><br>David</div>