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 provides 7 methods for working with Vector2 objects in Typescript programs. Available methods include: constructor, equals, getItem, parse, set, setItem, toString. All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package. Properties: length, length2, x, y.

Description

Vector2 is a class in the Aspose.3D FOSS library for TypeScript that exposes 6 methods and 4 properties for programmatic use.

Core capabilities include: number; number; number. These operations enable developers to integrate vector2 functionality directly into TypeScript applications.

The class also provides the length property (gets the length), the length2 property (gets the length2).

Instances are created through a single constructor that initializes the object with default values.

Properties

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

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)Sets the item value.
toString()string
equals(other: Vector2)booleanChecks whether another Vector2 has identical x and y values

See Also