textmode.math.js
v0.1.0
Published
Math helpers, easing, and vector math add-on for textmode.js
Downloads
203
Maintainers
Readme
textmode.math.js
textmode.math.js is a dedicated creative-coding math, easing, and vector library for textmode.js. It provides chainable 2D/3D vectors, 31 standard easing curves, angle and unit conversions, trigonometry, and value mapping either through an instance plugin (MathPlugin) or via lightweight, tree-shakeable standalone imports.
Shape motion, geometry, and transitions with expressive creative-coding primitives: animate characters along physics trajectories, smooth easing curves, calculate angles and distances, or remap sensor and audio inputs into visual ranges. Designed for clarity, performance, and flexibility, textmode.math.js keeps procedural animation and spatial algorithms clean whether working inside sketch draw loops or in headless modules.
Features
- Chainable 2D & 3D vectors -
TextmodeVectorwith arithmetic (add,sub,mult,div), magnitudes, limiting, heading in degrees, dot, and cross products - 31 easing curves - Standard quadratic, cubic, quartic, quintic, sinusoidal, exponential, circular, back, elastic, and bounce curves with clamped inputs and overshoot preservation
- Creative-coding mapping -
map,norm,lerp,constrain, andclampfor shaping signals and transitions - Trigonometry and geometry - Radians-based trigonometry (
sin,cos,tan,asin,acos,atan,atan2), degrees/radians conversions, and Euclidean distance calculations - Dual consumption models - Install
MathPluginto restoret.*instance methods onTextmodifier, or use tree-shakeable standalone functions without installing any plugin
Try it online first
Open editor.textmode.art, a browser-based live-coding environment for the
complete official textmode.js ecosystem. Sketches run as you edit, with no local toolchain required.
The editor includes textmode.js and all four official add-ons: textmode.export.js, textmode.filters.js,
textmode.figlet.js, and textmode.synth.js.
- Write with Monaco-powered completions, hover documentation, and diagnostics.
- Start with a blank sketch, an included example, or a community gallery sketch.
- Keep code and preferences saved in the browser, then share sketches through URL-based links.
- Use microphone or line-input analysis for audio-reactive work, and create on desktop or mobile.
Use it to experiment with vector physics, motion paths, and easing curves interactively while your sketch runs.
Installation
Follow the official installation guide to install
textmode.math.js alongside textmode.js with npm or browser-ready UMD bundles.
Next steps
- Read the math and vector documentation for math workflows, vector geometry, and easing curves.
- Browse the API reference for the complete typed API.
- Explore the examples to see vector physics, motion steering, and easing in action.
- Try editor.textmode.art to experiment with math and vectors in the browser.
Contributing
Thank you for considering contributing to this project! (✿◠‿◠)
Please read the Contributing Guide to get started.
Contributors
Thanks to the people who contribute code, documentation, design, examples, ideas, infrastructure, and care across the textmode.js ecosystem.
Contribution details and profile links are maintained on the textmode.js contributors page.
License
textmode.math.js is licensed under the MIT License.
