Vector3

Overview

Vector3 is a class in Aspose.3D FOSS for TypeScript.

Vector3.constructor creates a new Vector3 with given x, y, z components.

This class declares 19 methods for Vector3 objects in TypeScript programs. Available methods include: angleBetween, compareTo, constructor, cos, cross, dot, equals, getItem, minus, normalize, parse, set, and 4 additional methods. Public members are accessible to any TypeScript application after installing the Aspose.3D FOSS for TypeScript package. Properties: length, length2, one, unitX, unitY, unitZ, and 4 more.

Properties

NameTypeAccessDescription
xnumberRead/WriteGets the x.
ynumberRead/WriteGets the y.
znumberRead/WriteGets the z.
lengthnumberReadGets the length.
length2numberReadGets the length2.
zeroVector3ReadGets the zero.
oneVector3ReadGets the one.
unitXVector3ReadGets the unit x.
unitYVector3ReadGets the unit y.
unitZVector3ReadGets the unit z.

Methods

SignatureDescription
constructor(x: number, y: number, z: number)Creates a new Vector3 using either a number or FVector3 for x and separate y, z
constructor(vec: FVector3)Calls constructor(vec) on this Vector3 instance.
constructor(v: number)Calls constructor(v) on this Vector3 instance.
constructor(x: number | FVector3, y: number, z: number)Calls constructor(x, y, z) on this Vector3 instance.
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)Vector3Calls cross(rhs) on this Vector3 instance.
normalize()Vector3Returns a unit-length vector in the same direction
angleBetween(dir: Vector3, up: Vector3)numberReturns the angle in radians between this vector and dir, using up as reference
sin()Vector3Returns a vector whose components are the sine of this vector’s components
cos()Vector3Calls cos on this Vector3 instance.
compareTo(other: Vector3)numberReturns a numeric comparison of this vector with another vector
parse(input: string)Vector3Creates a Vector3 from a string representation
getItem(key: number)numberCalls getItem(key) on this Vector3 instance.
setItem(key: number, value: number)Sets the item value.
toString()stringCalls toString on this Vector3 instance.
equals(other: Vector3)booleanReturns true if this vector has the same components as another
minus(v: Vector3)Vector3Returns a new vector equal to this vector minus the given vector
times(scalar: number)Vector3Returns a new vector scaled by the given scalar

See Also

 English