type Primitives · Vectors

VectorLike

type VectorLike = { x: number; y: number } | number[]

A position or direction written as { x, y } or [x, y].

Accepted where a parameter has the type Point | VectorLike or Vector | VectorLike. The numbers are read when the function is called; nothing links to the object afterwards. Where a factory keeps the value as a vertex of a shape, it becomes a plain point (see Point).