[vtk-developers] New function: vtkMath::ProjectVector

David Doria daviddoria+vtk at gmail.com
Sun Sep 12 20:00:26 EDT 2010


On Sun, Sep 12, 2010 at 7:49 PM, John Platt <jcplatt at dsl.pipex.com> wrote:
> Hi David,
>
> There could be a quick exit when b[3] is a zero vector to avoid any trouble
> computing scale.
>
> There is the potential for round off damage and a small inefficiency by
> squaring the square root computed by Norm().
>
> I can't get {25./26., 5./26., 0} to make (1.2, -1.6, 0) in your test
> program.
>
> HTH
>
> John.

Hi John,

Thanks for looking at this. I added the test for an all zero b vector.
Sorry, it was my mistake in the test. I changed the vectors that the
test was using but I did not update the text of the error message
displayed if it failed. The test passes when the projection is the
vector  {25./26., 5./26., 0} (and it did and still does pass for me).

http://github.com/daviddoria/daviddoria-vtk/commit/7fc33a0ebe7c2b589e62f5db396ec4527ee57f79

Do you have a suggestion for how to overcome the roundoff error and
inefficiency of the squaring?

Thanks,

David D.



More information about the vtk-developers mailing list