Uranium
Application Framework
 All Classes Namespaces Files Functions Variables Pages
UM.Math.Vector.Vector Class Reference

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

Inherits object.

Public Member Functions

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

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 = None,
  y = None,
  z = None,
  data = None,
  round_digits = None 
)

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,
  epsilon = 1e-6 
)

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)

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: