Overview
Vector2 is a double-precision 2-component vector with x and y components. It is primarily used for UV texture coordinates and 2D calculations.
Package: com.aspose.threed
Constructor
| Signature | Description |
|---|
Vector2() | Constructs the zero vector (0, 0) |
Vector2(double x, double y) | Constructs from two components |
Vector2(Vector2 other) | Copy constructor |
Public Fields
Vector2 uses public fields for component access (not getter/setter methods):
| Field | Type | Access | Description |
|---|
x | double | v.x | X component |
y | double | v.y | Y component |
Computed Properties
| Name | Type | Getter | Description |
|---|
length | double | getLength() | Euclidean length, read-only |
length2 | double | getLength2() | Squared length, read-only |
Methods
| Method | Return Type | Description |
|---|
dot(Vector2 rhs) | double | Dot product with another Vector2 |
normalize() | Vector2 | Returns a unit-length copy |
set(double x, double y) | void | Sets both components in place |
compareTo(Vector2 other) | int | Lexicographic comparison: returns -1, 0, or 1 |
Example
See Also