space3 is a general purpose maths framework !
Brief
space3 is a rich and intuitive 3D maths API for algebra, geometry, ODE solving and curve manipulation.
It reaches surprisingly fast computation while keeping mathematical code natural to read and write.
Featuring
-
WebGL support with array based classes inheriting from
Float64Array
, column-major matrices, ... -
Three.js support with compatible 3D coordinates manipulation, ...
-
Vast API designed to perform maths computation useful for computer graphics, numerical simulation, mechanics, physics...
-
Object oriented and functional intuitive syntax that makes formulas easy to drop.
-
Written in Typescript with standardized interfaces to allow easily subclassing over the framework and make the API simpler to use.
-
Fully documented with step-by-step guides and a complete reference
Usage
Import
ES6 and Typescript
;;
With Typescript only, you can directly import sources
;
This makes the syntactic coloration more consistent.
Node.js
const space3 = ;const Vector3 = space3Vector3 Matrix3 = space3Matrix3;
Browser
WIP... Browser bundle coming soon. For now you can use a browser bundler such as browserify to transpile sources for browser.
Syntax overview
let u = 1 2 3 v = Vector3ones er = Vector3;let w = ;let r = 5;u;v; let m = Matrix3;v = m;u;m; let p = 1 2 3 Vector3ey q = Point3zeros;porigin = Vector3zeros;u = p;p;
Documentation
The documentation website contains a complete reference and step-by-step guides.
The guides are written such that beginners in maths and/or programming can easily get started but provides rigorous documentation for more advanced users.
Contributions
If you want to improve math javascript experience don't hesitate to contribute. All kind of improvements are welcomed !