Uranium
Application Framework
UM.Math.Vector.Vector Class Reference

Simple 3D-vector class based on numpy arrays. More...

Public Member Functions

def __init__
 Initialize a new vector. More...
 
def getData (self)
 Get numpy array with the data. More...
 
def setRoundDigits
 
def x (self)
 Return the x component of this vector.
 
def y (self)
 Return the y component of this vector.
 
def z (self)
 Return the z component of this vector.
 
def set
 
def angleToVector
 Get the angle from this vector to another.
 
def normalized (self)
 
def length (self)
 
def dot (self, other)
 
def cross (self, other)
 
def multiply
 
def preMultiply
 
def scale
 Scale a vector by another vector. More...
 
def __eq__ (self, other)
 
def equals
 Compares this vector to another vector. More...
 
def __add__ (self, other)
 
def __iadd__ (self, other)
 
def __sub__ (self, other)
 
def __isub__ (self, other)
 
def __mul__ (self, other)
 
def __imul__ (self, other)
 
def __rmul__ (self, other)
 
def __truediv__ (self, other)
 
def __itruediv__ (self, other)
 
def __rtruediv__ (self, other)
 
def __neg__ (self)
 
def __repr__ (self)
 
def __str__ (self)
 
def __lt__ (self, other)
 
def __gt__ (self, other)
 
def __le__ (self, other)
 
def __ge__ (self, other)
 

Public Attributes

 round_digits
 

Static Public Attributes

 Null = None
 
 Unit_X = None
 
 Unit_Y = None
 
 Unit_Z = None
 

Detailed Description

Simple 3D-vector class based on numpy arrays.

This class represents an immutable 3-dimensional vector.

Constructor & Destructor Documentation

def UM.Math.Vector.Vector.__init__ (   self,
  x 
)

Initialize a new vector.

Parameters
xX coordinate of vector.
yY coordinate of vector.
zZ coordinate of vector.

Member Function Documentation

def UM.Math.Vector.Vector.equals (   self,
  other 
)

Compares this vector to another vector.

Parameters
epsilonoptional tolerance value for the comparision.
Returns
True if the two vectors are the same.
def UM.Math.Vector.Vector.getData (   self,
  numpy,
  ndarray 
)

Get numpy array with the data.

Returns
numpy array of length 3 holding xyz data.
def UM.Math.Vector.Vector.scale (   self,
  other 
)

Scale a vector by another vector.

This will do a component-wise multiply of the two vectors.


The documentation for this class was generated from the following file: