|
From: Charles R H. <cha...@gm...> - 2006-02-17 16:22:56
|
On 2/17/06, Bill Baxter <wb...@gm...> wrote: > For folks using quats to represent rotations (which is all I use them for= , > anyway), if you're batch transforming a bunch of vectors by one quaternio= n, > it's a lot more efficient to convert the quat to a 3x3 matrix first and > transform using matrix multiply (9 mults per transform that way vs 21 or = so > depending on the implementation of q*v*q^-1). Given that, I can't see ma= ny > situations when I'd need a super speedy C version of quaternion multiply. > > --Bill True. On the other hand, I have files containing 20,000 quaternions, each of which needs to be converted to a rotation matrix and applied to some 400 vectors, so a c version would have its place. I have a python quaternion class that I use for such things but profiling shows that it is one of the prime time bandits, so I am tempted to use c for that class anyway. Note that the current NumPy cross product is implemented in Python. On a related note, indexing in numarray is some 3x faster than in NumPy and I'm wondering what needs to be done to speed that up. Chuck |