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
| Name | Type | Access | Description |
|---|---|---|---|
x | number | Read/Write | |
y | number | Read/Write | |
length | number | Read | |
length2 | number | Read | Property returns the squared magnitude of the vector |
Methods
| Signature | Description |
|---|---|
constructor(x: number, y: number) | |
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) | Assigns a value to the component at the given index (0 for x, 1 for y) |
toString() → string | |
equals(other: Vector2) → boolean | Checks whether another Vector2 has identical x and y values |