From: Aaron M. <ajm...@al...> - 2009-09-05 13:14:10
|
Hi VPython folks, I was attempting to run the contributed script http://vpython.org/contributed/bodies.py and I get an error... I have tracked it down to the fact that the dot product dot(a,b) between two vectors returns a type of numpy.float64 and when I multiply this by a vector I get back an array instead of a vector. A simple example that generates an error for me: from visual import * a=vector(1,0,0) b=dot(a,a)*a b.mag Here is the error: Traceback (most recent call last): File "Untitled", line 4 b.mag AttributeError: 'numpy.ndarray' object has no attribute 'mag' Of course, by assigning b as vector(dot(a,a)*a) we fix this, but it seems this should not be needed. Is this a bug? Thanks, Aaron Python 2.6.2 with VPython 5.12 ------------------------------------------------------ Aaron J. Miller, Ph.D. Department of Physics 328 Palenske Hall Albion College, Albion, MI 49224 |