---
Product: Aspose.3D
Platform: typescript
Page Type: reference
Canonical URL: https://reference.aspose.org/3d/typescript/Vector4
---

# Vector4

## Overview

`Vector4` is a class in Aspose.3D FOSS for Typescript.

Vector4.constructor creates a new Vector4 with default components (0,0,0,0).

This class provides 6 methods for working with Vector4 objects in Typescript programs.
Available methods include: `constructor`, `equals`, `getItem`, `set`, `setItem`, `toString`.
All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package.
Properties: `w`, `x`, `y`, `z`.

## Description

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

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

The class offers 5 constructor overloads, allowing flexible initialization depending on the calling context.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `x` | `number` | Read/Write | Gets the x. |
| `y` | `number` | Read/Write | Gets the y. |
| `z` | `number` | Read/Write | Gets the z. |
| `w` | `number` | Read/Write | Gets the w. |

## Methods

| Signature | Description |
|-----------|-------------|
| `constructor()` | Creates a Vector4 from a mixed first argument (FVector2, FVector3, or number) and y, z, w numbers |
| `constructor(x: number, y: number, z: number, w: number)` | Creates a Vector4 with the specified x, y, z, and w double components |
| `constructor(vec3: FVector3, w: number)` | Creates a Vector4 from an FVector3 and a double w component |
| `constructor(vec: FVector2, w: number)` | Creates a Vector4 from an FVector2 and a double w component |
| `constructor(x: FVector2 \| FVector3 \| number, y: number, z: number, w: number)` | Creates a Vector4 from a mixed first argument and remaining double components |
| `set(newX: number, newY: number, newZ: number, newW: number)` | Assigns new values to x, y, z, and w components |
| `getItem(key: number)` → `number` | Returns the component value at the given index (0=x, 1=y, 2=z, 3=w) |
| `setItem(key: number, value: number)` | Sets the item value. |
| `toString()` → `string` | Returns a string representation of this vector |
| `equals(other: Vector4)` → `boolean` | Returns true if all components match the other Vector4 |

## See Also

- [Aspose.3D — Enterprise API Reference](https://reference.aspose.com/3d/)