Skip to content

@vaguevoid/fiasco / math/vector / vec

Function: vec()

Call Signature

vec(x, y): Vector

Defined in: src/math/vector.ts:557

construct a 2d vector from x and y values

Parameters

x

number

y

number

Returns

Vector

Call Signature

vec(xy): Vector

Defined in: src/math/vector.ts:561

construct a 2d vector from a single value, using it for both x and y

Parameters

xy

number

Returns

Vector

Call Signature

vec(vector): Vector

Defined in: src/math/vector.ts:565

construct a 2d vector from another vector

Parameters

vector

Vec2

Returns

Vector

Call Signature

vec(vector): Vector

Defined in: src/math/vector.ts:569

construct a 2d vector from a two element array

Parameters

vector

number[]

Returns

Vector