linearly v0.32.0Docs


linearly v0.32.0 / vec2 / dir

Function: dir()

dir(deg, length, origin): vec2

Alias for vec2.direction

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:653open in new window