Vector3

Overview

Vector3 is a class in Aspose.3d for Typescript. Inherits from: Vector3.

Vector3 provides full 3‑D vector functionality including dot and cross products, normalization, angle calculation, trigonometric helpers, component‑wise arithmetic, and static unit vectors (zero, one, unitX/Y/Z).

Properties

NameTypeAccessDescription
xnumberReadIs the X coordinate of the vector
ynumberRead
znumberRead
lengthnumberRead
length2numberReadIs the squared length of the vector
zeroVector3ReadIs a static vector (0,0,0)
oneVector3ReadIs a static vector (1,1,1)
unitXVector3ReadIs a static unit vector along the X axis (1,0,0)
unitYVector3Read
unitZVector3Read

Methods

SignatureDescription
constructor(x: number, y: number, z: number)Creates a new Vector3 from components, a single value, or another FVector3
constructor(vec: FVector3)
constructor(v: number)
constructor(x: number | FVector3, y: number, z: number)
set(newX: number, newY: number, newZ: number)Assigns new X, Y, Z values to the vector
dot(rhs: Vector3)numberReturns the dot product of this vector with another Vector3
cross(rhs: Vector3)Vector3
normalize()Vector3Returns a unit-length vector in the same direction
angleBetween(dir: Vector3, up: Vector3)numberReturns the angle in radians between this direction and another, using an up vector
sin()Vector3Returns a vector whose components are the sine of this vector’s components
cos()Vector3
compareTo(other: Vector3)numberReturns a numeric comparison result with another Vector3
parse(input: string)Vector3Creates a Vector3 from a string representation
getItem(key: number)number
setItem(key: number, value: number)Sets the component at the given index to a value
toString()string
equals(other: Vector3)booleanChecks if this vector equals another Vector3
minus(v: Vector3)Vector3Returns a new Vector3 that is this vector minus another
times(scalar: number)Vector3Returns a new Vector3 scaled by the given scalar