[vtkusers] Angle between two vectors

David Cole dlrdave at aol.com
Mon Jan 6 15:14:05 EST 2014


Thanks for the continued discussion -- (I agree with Sean, this is 
interesting...)

I agree with you 100% that any method that goes into VTK should use 
atan2, and prefer correctness over performance.

For my case, I am sure the acos method requires less math because my 
inputs are already guaranteed to be unit vectors. And therefore, also 
guaranteed to be non-0 length.

Thanks for the reminder about using "[3]" for the sake of the wrappers. 
I'll use this method signature when I submit a patch:

     double vtkMath::AngleBetweenVectors(const double v1[3], const 
double v2[3])


Cheers,
David C.



More information about the vtkusers mailing list