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.

This class declares 7 methods for Vector2 objects in TypeScript programs. Available methods include: constructor, equals, getItem, parse, set, setItem, toString. Public members are accessible to any TypeScript application after installing the Aspose.3D FOSS for TypeScript package. Properties: length, length2, x, y.

Properties

NameTypeAccessDescription
xnumberRead/WriteGets the x.
ynumberRead/WriteGets the y.
lengthnumberReadGets the length.
length2numberReadGets the length2.

Methods

SignatureDescription
constructor(x: number, y: number)Calls constructor(x, y) on this Vector2 instance.
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)Sets the item value.
toString()stringCalls toString on this Vector2 instance.
equals(other: Vector2)booleanChecks whether another Vector2 has identical x and y values

See Also

 English