Vector2
Overview
Vector2 is a class in Aspose.3D FOSS for Java.
Inherits from: Serializable, Comparable<Vector2>.
Vector2 and Vector3 classes provide basic vector math operations such as dot, cross, normalization, and length calculation.
This class provides 24 methods for working with Vector2 objects in Java programs.
Available methods include: Vector2, add, compareTo, cross, div, dot, equals, getLength, getU, getV, hashCode, mul, and 7 additional methods.
All public members are accessible to any Java application after installing the Aspose.3D FOSS for Java package.
Properties: length, u, v.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
u | double | Read | Gets the u. |
v | double | Read | Gets the v. |
length | double | Read | Gets the length. |
Methods
| Signature | Description |
|---|---|
Vector2() | Initializes the vector with the specified x and y values |
Vector2(x: double, y: double) | Calls Vector2(x, y) on this Vector2 instance. |
Vector2(vec: Vector3) | Calls Vector2(vec) on this Vector2 instance. |
Vector2(vec: FVector2) | Calls Vector2(vec) on this Vector2 instance. |
getU() → double | Returns the u. |
setU(value: double) | Sets the u value. |
getV() → double | Returns the v. |
setV(value: double) | Sets the v value. |
getLength() → double | Returns the length. |
dot(rhs: Vector2) → double | Calls dot(rhs) on this Vector2 instance. |
equals(rhs: Vector2) → boolean | Calls equals(rhs) on this Vector2 instance. |
equals(obj: Object) → boolean | Calls equals(obj) on this Vector2 instance. |
hashCode() → int | Calls hashCode on this Vector2 instance. |
toString() → String | Calls toString on this Vector2 instance. |
cross(v: Vector2) → double | Calls cross(v) on this Vector2 instance. |
normalize() → Vector2 | Calls normalize on this Vector2 instance. |
compareTo(other: Vector2) → int | Calls compareTo(other) on this Vector2 instance. |
add(lhs: Vector2, rhs: Vector2) → Vector2 | Calls add(lhs, rhs) on this Vector2 instance. |
sub(lhs: Vector2, rhs: Vector2) → Vector2 | Calls sub(lhs, rhs) on this Vector2 instance. |
div(lhs: Vector2, rhs: double) → Vector2 | Calls div(lhs, rhs) on this Vector2 instance. |
mul(lhs: Vector2, rhs: double) → Vector2 | Calls mul(lhs, rhs) on this Vector2 instance. |
mul(lhs: double, rhs: Vector2) → Vector2 | Calls mul(lhs, rhs) on this Vector2 instance. |
op_eq(lhs: Vector2, rhs: Vector2) → boolean | Calls op_eq(lhs, rhs) on this Vector2 instance. |
op_ne(lhs: Vector2, rhs: Vector2) → boolean | Calls op_ne(lhs, rhs) on this Vector2 instance. |