Vector2 class
Vector2 class
A vector with two components.
The Vector2 type exposes the following members:
Constructors
| Constructor | Description |
|---|---|
__init__(self, s) | Initializes a new instance of the Vector2 struct. |
__init__(self, s) | Initializes a new instance of the Vector2 struct. |
__init__(self, vec) | Initializes a new instance of the Vector2 struct. |
__init__(self, x, y) | Initializes a new instance of the Vector2 struct. |
__init__(self) | Constructs a new instance of Vector2 |
Properties
| Property | Description |
|---|---|
| u | Gets or sets the U component if the Vector2 is used as a mapping coordinate.It’s an alias of x component. |
| v | Gets or sets the V component if the Vector2 is used as a mapping coordinate.It’s an alias of y component. |
| length | Gets the length. |
| x | The x component. |
| y | The y component. |
Methods
| Method | Description |
|---|---|
dot(self, rhs) | Gets the dot product of two vectors |
equals(self, rhs) | Check if two vector2 equals |
cross(self, v) | Cross product of two vectors |
normalize(self) | Normalizes this instance. |
compare_to(self, other) | Compare current vector to another instance. |
See Also
- module
aspose.threed.utilities - class
Vector2