Examples

Live demos of Vectra in action — each one runs in a single file with no build step required

How to explore

Every example is a self-contained page: open it, interact with the demo and read the annotated source code right below the canvas.

Under the hood

Demos import the compiled library from lib/index.js directly in the browser, so you can inspect and modify them without any bundler.

Vector Sum

Two vectors added head‑to‑tail with their resultant drawn live — the red vector rotates to show how the sum changes.

demo vector canvas

Rect Operations

Bouncing rectangles with their intersection, union and point‑containment highlighted live — move the mouse to test Rect.contains.

demo rect input

Matrix3 Transform

Drag sliders to compose translation, rotation and scale into a Matrix3 and watch an arrow, its basis vectors and the inverse transform update live.

demo matrix canvas