Vector2

Overview

Vector2 is a class in Aspose.3D FOSS for Typescript.

Vector2.set updates the vector’s x and y components to new values.

Properties

NameTypeAccessDescription
xnumberRead/Write
ynumberRead/Write
lengthnumberRead
length2numberReadProperty returns the squared magnitude of the vector

Methods

SignatureDescription
constructor(x: number, y: number)
set(newX: number, newY: number)Updates the vector’s x and y components to new values
parse(input: string)Vector2Creates a Vector2 instance from a string representation
getItem(key: number)numberReturns the component value at the given index (0 for x, 1 for y)
setItem(key: number, value: number)Assigns a value to the component at the given index (0 for x, 1 for y)
toString()string
equals(other: Vector2)booleanChecks whether another Vector2 has identical x and y values

See Also