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
| Name | Type | Access | Description |
|---|---|---|---|
x | number | Read/Write | Gets the x. |
y | number | Read/Write | Gets the y. |
length | number | Read | Gets the length. |
length2 | number | Read | Gets the length2. |
Methods
| Signature | Description |
|---|---|
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) → Vector2 | Creates a Vector2 instance from a string representation |
getItem(key: number) → number | Returns the component value at the given index (0 for x, 1 for y) |
setItem(key: number, value: number) | Sets the item value. |
toString() → string | Calls toString on this Vector2 instance. |
equals(other: Vector2) → boolean | Checks whether another Vector2 has identical x and y values |