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

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

Inherits object.

Public Member Functions

def __init__ (self, x=None, y=None, z=None, data=None, round_digits=None)
 Initialize a new vector. More...
 
def getData (self)
 Get numpy array with the data. More...
 
def setRoundDigits (self, digits)
 
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 (self, x=None, y=None, z=None)
 
def angleToVector (self, vector)
 Get the angle from this vector to another.
 
def normalized (self)
 
def length (self)
 
def dot (self, other)
 
def cross (self, other)
 
def multiply (self, matrix)
 
def preMultiply (self, matrix)
 
def scale (self, other)
 Scale a vector by another vector. More...
 
def __eq__ (self, other)
 
def equals (self, other, epsilon=1e-6)
 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

◆ __init__()

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

◆ equals()

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.

◆ getData()

def UM.Math.Vector.Vector.getData (   self)

Get numpy array with the data.

Returns
numpy array of length 3 holding xyz data.

◆ scale()

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: