Is there a Vector3 type in Python?

I quickly checked numPy, but it looks like it uses arrays as vectors? I am looking for a suitable Vector3 type that I can use and work.

+4
source share
3 answers

ScientificPython has a Vector class. eg:

In [1]: from Scientific.Geometry import Vector In [2]: v1 = Vector(1, 2, 3) In [3]: v2 = Vector(0, 8, 2) In [4]: v1.cross(v2) Out[4]: Vector(-20.000000,-2.000000,8.000000) In [5]: v1.normal() Out[5]: Vector(0.267261,0.534522,0.801784) In [6]: v2.cross(v1) Out[6]: Vector(20.000000,2.000000,-8.000000) In [7]: v1*v2 # dot product Out[7]: 22.0 
+4
source

Found this one , maybe he can do what you want.

+5
source

I do not believe that there is something standard (but I could be wrong, I am not too good at python).

This is very simple to implement, and you might want to build on top of the numpy array as a container for it anyway, which gives you a lot of good (and efficient) bits and parts.

+2
source

All Articles