Vector3 class
Vector3 class
A vector with three components.
The Vector3 type exposes the following members:
Constructors
Constructor | Description |
---|---|
__init__(self, x, y, z) | Initializes a new instance of the Vector3 struct. |
__init__(self, vec) | Initializes a new instance of the Vector3 struct. |
__init__(self, v) | Initializes a new instance of the Vector3 struct. |
__init__(self, vec4) | Initializes a new instance of the Vector3 struct. |
__init__(self) | Constructs a new instance of Vector3 |
Properties
Property | Description |
---|---|
length2 | Gets the square of the length. |
length | Gets the length of this vector. |
zero | Gets unit vector (0, 0, 0) |
one | Gets unit vector (1, 1, 1) |
unit_x | Gets unit vector (1, 0, 0) |
unit_y | Gets unit vector (0, 1, 0) |
unit_z | Gets unit vector (0, 0, 1) |
x | The x component. |
y | The y component. |
z | The z component. |
Indexer
Name | Description |
---|---|
[index] |
Methods
Method | Description |
---|---|
angle_between(self, dir, up) | Calculate the inner angle between two direction Two direction can be non-normalized vectors |
angle_between(self, dir) | Calculate the inner angle between two direction Two direction can be non-normalized vectors |
dot(self, rhs) | Gets the dot product of two vectors |
normalize(self) | Normalizes this instance. |
sin(self) | Calculates sine on each component |
cos(self) | Calculates cosine on each component |
cross(self, rhs) | Cross product of two vectors |
set(self, new_x, new_y, new_z) | Sets the x/y/z component in one call. |
compare_to(self, other) | Compare current vector to another instance. |
See Also
- module
aspose.threed.utilities
- class
Vector3