Vector3
Overview
Vector3 is a class in Aspose.3D FOSS for Java.
Inherits from: Struct<Vector3>, Serializable, Comparable<Vector3>.
This class provides 40 methods and 7 properties for working with Vector3 objects in Java.
Available methods include: Vector3, add, angleBetween, clone, compareTo, copyFrom, cos, create, cross, div, dot, equals, and additional methods.
Properties: length, length2, one, unitX, unitY, unitZ, zero.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
zero | Vector3 | Read | Gets the zero. |
one | Vector3 | Read | Gets the one. |
unitX | Vector3 | Read | Gets the unit x. |
unitY | Vector3 | Read | Gets the unit y. |
unitZ | Vector3 | Read | Gets the unit z. |
length | double | Read | Gets the length. |
length2 | double | Read | Gets the length2. |
Methods
| Signature | Description |
|---|---|
Vector3() | Creates a zero vector (0, 0, 0) |
Vector3(x: double, y: double, z: double) | Creates a vector with the specified x, y, z double components |
Vector3(val: double) | Creates a vector with all three components set to val |
Vector3(fv3: FVector3) | Creates a vector from the given FVector3 |
Vector3(v4: Vector4) | Creates a vector from the x, y, z components of the given Vector4 |
getZero() → Vector3 | Returns the zero. |
getOne() → Vector3 | Returns the one. |
getUnitX() → Vector3 | Returns the unit x. |
getUnitY() → Vector3 | Returns the unit y. |
getUnitZ() → Vector3 | Returns the unit z. |
set(x: double, y: double, z: double) | Sets the x, y, z components of this vector |
getLength() → double | Returns the length. |
getLength2() → double | Returns the length2. |
normalize() → Vector3 | Returns a normalized (unit length) copy of this vector |
dot(v: Vector3) → double | Returns the dot product of this vector and v |
cross(v: Vector3) → Vector3 | Returns the cross product of this vector and v |
add(a: Vector3, b: Vector3) → Vector3 | Returns the component-wise sum of vectors a and b |
sub(a: Vector3, b: Vector3) → Vector3 | Returns the component-wise difference of vectors a and b |
mul(a: Vector3, b: Vector3) → Vector3 | Returns the component-wise product of vectors a and b |
mul(v: Vector3, s: double) → Vector3 | Returns vector v scaled by scalar s |
mul(s: double, v: Vector3) → Vector3 | Returns scalar s multiplied by vector v |
div(v: Vector3, s: double) → Vector3 | Returns vector v divided by scalar s |
div(a: Vector3, b: Vector3) → Vector3 | Returns the component-wise quotient of vectors a and b |
negative(v: Vector3) → Vector3 | Returns the negation of vector v |
op_eq(a: Vector3, b: Vector3) → boolean | Returns true if vectors a and b are equal |
op_ne(a: Vector3, b: Vector3) → boolean | Returns true if vectors a and b are not equal |
get(index: int) → double | Returns the component at index 0 (x), 1 (y), or 2 (z) |
set(index: int, value: double) | Sets the component at index 0 (x), 1 (y), or 2 (z) to value |
angleBetween(a: Vector3, b: Vector3) → double | Returns the angle in radians between vectors a and b |
angleBetween(v: Vector3) → double | Returns the angle in radians between this vector and v |
create(v: Vector3) → FVector3 | Creates a new FVector3 from the given Vector3 |
equals(obj: Object) → boolean | Returns true if obj is a Vector3 equal to this vector |
hashCode() → int | Returns the hash code of this vector |
toString() → String | Returns a string representation of this vector |
clone() → Vector3 | Returns a copy of this vector |
copyFrom(src: Vector3) | Copies the x, y, z components of src into this vector |
compareTo(other: Vector3) → int | Compares this vector with other; returns a negative, zero, or positive integer |
sin() → Vector3 | Returns a vector with each component set to the sine of the corresponding component |
cos() → Vector3 | Returns a vector with each component set to the cosine of the corresponding component |
parse(s: String) → Vector3 | Parses a string representation and returns the corresponding Vector3 |