Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Math.Vector.Vector Class Reference

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

Inherits object.

Public Member Functions

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

Public Attributes

 round_digits
 
 x
 
 y
 
 z
 

Static Public Attributes

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

Protected Member Functions

 _normalizeVector (self, data)
 Return length, i.e.
 

Protected Attributes

 _data
 

Detailed Description

Simple 3D-vector class based on numpy arrays.

This class represents an immutable 3-dimensional vector.

Constructor & Destructor Documentation

◆ __init__()

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

◆ _normalizeVector()

UM.Math.Vector.Vector._normalizeVector (   self,
  data 
)
protected

Return length, i.e.

Euclidean norm, of ndarray along axis.

◆ equals()

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()

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

Get numpy array with the data.

Returns
numpy array of length 3 holding xyz data.

◆ scale()

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: