type Primitives · Vectors

PinLike

type PinLike = { x: number; y: number } | { dx: number; dy: number; x: number; y: number } | [number, number] | [number, number, number, number]

A pin written as an object or array: { x, y }, { x, y, dx, dy }, [x, y] or [x, y, dx, dy].

Without a direction, the direction is (1, 0). The formats:

  • { x: number, y: number } - Object with x, y coordinates
  • { x: number, y: number, dx: number, dy: number } - Object with x, y coordinates and direction vector dx, dy
  • [number, number] - Tuple with [x, y] coordinates
  • [number, number, number, number] - Tuple with [x, y, dx, dy] coordinates and direction vector