Returns an { x, y } signed vector corresponding to the provided cardinal direction.
{ x, y }
const n = getVectorFromCardinal(`n`); // {x: 0, y: -1} Copy
const n = getVectorFromCardinal(`n`); // {x: 0, y: -1}
Optional multiplier can be applied to vector
multiplier
const n = getVectorFromCardinal(`n`, 10); // {x: 0, y: -10} Copy
const n = getVectorFromCardinal(`n`, 10); // {x: 0, y: -10}
Blank direction returns { x: 0, y: 0 }
{ x: 0, y: 0 }
Direction
Multipler
Signed vector in the form of { x, y }
Returns an
{ x, y }
signed vector corresponding to the provided cardinal direction.Optional
multiplier
can be applied to vectorBlank direction returns
{ x: 0, y: 0 }