Appearance
Scientific geometry
Vector fields
const { field, scale } = swirl(n);
const arrows = plot.uploadVectorField(field, scale);
plot.showVectorField(arrows);
plot.frameScene();
return { readout: `${(n * n * n).toLocaleString("en-GB")} arrows` };Calls
3 in the code above, in the order it makes them
plot.uploadVectorField(field: VectorField, scale: number): VectorFieldHandleUpload a vector field and return a handle naming it.
scalemultiplies every arrow's length. There is no way to derive it: the field and the scene are different quantities, and only the caller knows how they should compare on screen.plot.showVectorField(handle: VectorFieldHandle): voidDraw the vector field
handlenames.plot.frameScene(): voidPoint the camera at the middle of everything uploaded, far enough back to see it.
Call after uploading. A scene measured in grid cells or in millimetres is nowhere near where a camera starts, and without this the first thing a caller sees is an empty canvas.