Playground
Numbers computed here, not drawn here.
Both panels call the library compiled to JavaScript and running in this tab. The page supplies the shape of the question and draws the answer; every value in the answer comes back from the array code.
The compiled engine did not load. It is built from
src/examples/browser/ and served at engine/moonvec.js; open this page
from the deployed site, or build it with the command in the guide.
Broadcast two shapes
Pick an operand on each side. Compatible shapes stretch and add elementwise; incompatible ones are refused with the library's own message, before anything is read.
Fit a line while you drag
Eight points, and a straight line chosen by least squares. Move a point and the
coefficients are computed again by lstsq, which factors the design matrix
with Householder reflections.
Drag a point. Dashed segments are the residuals the fit is minimising.
- slope
- —
- intercept
- —
- residual
- —
—
src/examples/browser/, a package that imports this library and exposes two
functions: one broadcasts a pair of shapes, the other fits a line. The drawing code knows
nothing about arrays.