FVector2

Overview

FVector2 is a class in Aspose.3D FOSS for Typescript.

FVector2.constructor creates a new vector with the specified x and y components.

Properties

NameTypeAccessDescription
xnumberRead/WriteStores the horizontal component of the vector
ynumberRead/WriteStores the vertical component of the vector

Methods

SignatureDescription
constructor(x: number, y: number)Creates a new vector with the specified x and y components
toString()stringReturns a string representation of the vector in the form “(x, y)”
equals(other: FVector2)booleanReturns true if the other vector has identical x and y values
add(other: FVector2)FVector2Returns a new FVector2 that is the component‑wise sum of this vector and the other
sub(other: FVector2)FVector2Returns a new FVector2 that is the component‑wise difference between this vector and the other
mul(scalar: number)FVector2Returns a new FVector2 scaled by the given scalar
div(scalar: number)FVector2Returns a new FVector2 divided by the given scalar
length()number
normalize()FVector2Returns a unit vector in the same direction as this vector
dot(other: FVector2)numberReturns the dot product of this vector with the other vector
parse(input: string)FVector2Creates an FVector2 from a string containing two numeric components

See Also