interface Primitives · Vectors

Vector

interface Vector

Two numbers, x and y: a direction or a displacement, and the base of Point and Pin.

Vectors computes with vectors (length, angle, rotation, …). Where a parameter has the type Vector | VectorLike, { x, y } and [x, y] work too.

Properties

x

x: number

The horizontal component; it grows to the right.

y

y: number

The vertical component. In a graphic's coordinates, as in SVG, it grows downwards.