XYZ (3D) Vectors
FloatVector3
Bases: BaseVector3
3D Float Vector Array.
Create a new 3D, float-based vector array.
| PARAMETER | DESCRIPTION |
|---|---|
x
|
Coordinate on the X-axis.
TYPE:
|
y
|
Coordinate on the Y-axis.
TYPE:
|
z
|
Coordinate on the Z-axis.
TYPE:
|
copy
copy() -> FloatVector3
Copy this vector into another instance of the same vector.
| RETURNS | DESCRIPTION |
|---|---|
FloatVector3
|
This vector as another instance. |
cross
cross(other: FloatVector3) -> FloatVector3
Calculate the cross product of this vector with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other vector cross with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FloatVector3
|
The resulting cross product vector. |
dot
dot(other: FloatVector3) -> float
Calculate the dot product of this vector with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other vector to calculate the dot product with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The dot product of these two vectors. |
from_iterable
classmethod
from_iterable(
iterable: Union[
FloatVector3,
IntVector3,
np.ndarray[np.float32],
tuple[
Union[int, float],
Union[int, float],
Union[int, float],
],
list[Union[int, float]],
],
) -> FloatVector3
Create a new 3D, float-based vector array from an iterable with 3 float or int values.
| PARAMETER | DESCRIPTION |
|---|---|
iterable
|
The iterable with 3
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
FloatVector3
|
The new 3D, |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the provided iterable contains more or less than 3 values |
normalize
normalize() -> FloatVector3
Normalize this vector.
| RETURNS | DESCRIPTION |
|---|---|
FloatVector3
|
The normalized vector. |
| RAISES | DESCRIPTION |
|---|---|
ZeroDivisionError
|
If the magnitude of this vector is 0 |
to_numpy
Return this vector as an instance of a NumPy array.
| PARAMETER | DESCRIPTION |
|---|---|
copy
|
If this method should return a copy of the internal
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
numpy.ndarray[numpy.float32]
|
This vector as an instance of a |
Warning
If you return the array itself, any changes to that array will change this vector object.
to_tuple
IntVector3
Bases: BaseVector3
3D Integer Vector Array.
Create a new 3D, int-based vector array.
| PARAMETER | DESCRIPTION |
|---|---|
x
|
Coordinate on the X-axis.
TYPE:
|
y
|
Coordinate on the Y-axis.
TYPE:
|
z
|
Coordinate on the Z-axis.
TYPE:
|
copy
copy() -> IntVector3
Copy this vector into another instance of the same vector.
| RETURNS | DESCRIPTION |
|---|---|
IntVector3
|
This vector as another instance. |
cross
cross(other: IntVector3) -> IntVector3
Calculate the cross product of this vector with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other vector cross with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IntVector3
|
The resulting cross product vector. |
dot
dot(other: IntVector3) -> float
Calculate the dot product of this vector with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other vector to calculate the dot product with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The dot product of these two vectors. |
from_iterable
classmethod
from_iterable(
iterable: Union[
IntVector3,
np.ndarray[np.int32],
tuple[int, int, int],
list[int],
],
) -> IntVector3
Create a new 3D, int-based vector array from an iterable with 3 int values.
| PARAMETER | DESCRIPTION |
|---|---|
iterable
|
The iterable with 3
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IntVector3
|
The new 3D, |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the provided iterable contains more or less than 3 values |
normalize
normalize() -> FloatVector3
Normalize this vector.
| RETURNS | DESCRIPTION |
|---|---|
FloatVector3
|
The normalized vector. |
| RAISES | DESCRIPTION |
|---|---|
ZeroDivisionError
|
If the magnitude of this vector is 0 |
to_numpy
Return this vector as an instance of a NumPy array.
| PARAMETER | DESCRIPTION |
|---|---|
copy
|
If this method should return a copy of the internal
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
numpy.ndarray[numpy.int32]
|
This vector as an instance of a |
Warning
If you return the array itself, any changes to that array will change this vector object.