FVector2
Overview
FVector2 is a class in Aspose.3d for Typescript.
Inherits from: FVector2.
FVector2 implements a 2‑D vector with getters/setters for x and y, arithmetic operations, length, normalization, dot product, and a static parse method.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
x | number | Read | Stores the horizontal component of the vector |
y | number | Read | Stores the vertical component of the vector |
Methods
| Signature | Description |
|---|---|
constructor(x: number, y: number) | Creates a new vector with the specified x and y components |
toString() → string | Returns a string representation of the vector in the form ‘(x, y)’ |
equals(other: FVector2) → boolean | Returns true if the other vector has identical x and y values |
add(other: FVector2) → FVector2 | Returns a new FVector2 that is the component‑wise sum of this and other |
sub(other: FVector2) → FVector2 | |
mul(scalar: number) → FVector2 | Returns a new FVector2 whose components are this vector multiplied by scalar |
div(scalar: number) → FVector2 | |
length() → number | |
normalize() → FVector2 | Returns a unit vector in the same direction as this vector |
dot(other: FVector2) → number | Returns the dot product of this vector with the other vector |
parse(input: string) → FVector2 | Creates a FVector2 from a string containing two numeric values |