linearly v0.32.0Docs


linearly v0.32.0 / vec2 / direction

Function: direction()

direction(deg, length, origin): vec2

Creates a vector by given direction, length, and origin

Parameters

deg: number

The direction in degrees

length: number = 1

The length of the vector to create. Default is 1

origin: vec2 = vec2.zero

The origin of the vector. Default is [0, 0]

Returns

vec2

Shorthands

Defined in

src/vec2.ts:642open in new window