Uranium
Application Framework
|
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 | __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 | |
Simple 3D-vector class based on numpy arrays.
This class represents an immutable 3-dimensional vector.
def UM.Math.Vector.Vector.__init__ | ( | self, | |
x = None , |
|||
y = None , |
|||
z = None , |
|||
data = None , |
|||
round_digits = None |
|||
) |
Initialize a new vector.
x | X coordinate of vector. |
y | Y coordinate of vector. |
z | Z coordinate of vector. |
def UM.Math.Vector.Vector.equals | ( | self, | |
other, | |||
epsilon = 1e-6 |
|||
) |
Compares this vector to another vector.
epsilon | optional tolerance value for the comparision. |
def UM.Math.Vector.Vector.getData | ( | self | ) |
Get numpy array with the 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.