From: Arthur S. <aj...@ix...> - 2002-06-22 20:49:58
|
I am refactoring some code, focusing on performance issues. And find it quite common in my code to be calculating the squared length of a vector. A look at cvisual finds mag2() already there as the underlying function for mag(), but it is not exposed to Python. So in doing mag(vector)**2 I am essentially calculating a square root(in C) and then squaring it (in Python). Unpretty. I did the trivial work to expose mag2 as a Python function, and am using it, and hoping the change could be made in the "official" distribution Art |