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

NameTypeAccessDescription
zeroVector3ReadGets the zero.
oneVector3ReadGets the one.
unitXVector3ReadGets the unit x.
unitYVector3ReadGets the unit y.
unitZVector3ReadGets the unit z.
lengthdoubleReadGets the length.
length2doubleReadGets the length2.

Methods

SignatureDescription
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()Vector3Returns the zero.
getOne()Vector3Returns the one.
getUnitX()Vector3Returns the unit x.
getUnitY()Vector3Returns the unit y.
getUnitZ()Vector3Returns the unit z.
set(x: double, y: double, z: double)Sets the x, y, z components of this vector
getLength()doubleReturns the length.
getLength2()doubleReturns the length2.
normalize()Vector3Returns a normalized (unit length) copy of this vector
dot(v: Vector3)doubleReturns the dot product of this vector and v
cross(v: Vector3)Vector3Returns the cross product of this vector and v
add(a: Vector3, b: Vector3)Vector3Returns the component-wise sum of vectors a and b
sub(a: Vector3, b: Vector3)Vector3Returns the component-wise difference of vectors a and b
mul(a: Vector3, b: Vector3)Vector3Returns the component-wise product of vectors a and b
mul(v: Vector3, s: double)Vector3Returns vector v scaled by scalar s
mul(s: double, v: Vector3)Vector3Returns scalar s multiplied by vector v
div(v: Vector3, s: double)Vector3Returns vector v divided by scalar s
div(a: Vector3, b: Vector3)Vector3Returns the component-wise quotient of vectors a and b
negative(v: Vector3)Vector3Returns the negation of vector v
op_eq(a: Vector3, b: Vector3)booleanReturns true if vectors a and b are equal
op_ne(a: Vector3, b: Vector3)booleanReturns true if vectors a and b are not equal
get(index: int)doubleReturns 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)doubleReturns the angle in radians between vectors a and b
angleBetween(v: Vector3)doubleReturns the angle in radians between this vector and v
create(v: Vector3)FVector3Creates a new FVector3 from the given Vector3
equals(obj: Object)booleanReturns true if obj is a Vector3 equal to this vector
hashCode()intReturns the hash code of this vector
toString()StringReturns a string representation of this vector
clone()Vector3Returns a copy of this vector
copyFrom(src: Vector3)Copies the x, y, z components of src into this vector
compareTo(other: Vector3)intCompares this vector with other; returns a negative, zero, or positive integer
sin()Vector3Returns a vector with each component set to the sine of the corresponding component
cos()Vector3Returns a vector with each component set to the cosine of the corresponding component
parse(s: String)Vector3Parses a string representation and returns the corresponding Vector3

See Also