The Typescript Math Toolkit Open Source Project


When I first started the Javascript Math Toolkit, I had visions of an open-source project.  Then, my mind immediately flashed back to the CompGeoJS project and the massive support issues it generated, which was largely students wanting help with their computational geometry homework.  Although I’m a pretty generous person, I can’t manage over 50 emails a day on a project that does not generate a dime of revenue.

Now that I’m coding Java on the back end and Typescript/Angular 2 on the front end, my interest has shifted from a low-level JS library to a Typescript library.  I’ve also been very fortunate to find a few people willing to help out on the enormous task of creating demos and other infrastructure necessary to make a large-scale math library useful to front-end developers.

It is important that the library and all its supporting demos and documentation stand on their own as while the code is free, support is not.  The only way I can provide direct support for the library is to fork the code for a client and bill for my time.  I do hope that the documentation and demos will be sufficient, but it is likely that in order to keep the library free and open-source, I may need to add a couple people to the team to function in a strict support (Q & A) role in order to free my time up for pure development.

I hope to add more detail in the next week, but I suspect the library will be released under an Apache 2, MIT, or similar license.  The library currently exists in carefully handcoded ES5.  It will be rewritten entirely in Typescript.  All demos will be in Angular 2.  Some of the existing demos will be re-packaged into a Components library.

For example, here is a screen shot of the Numerline demo.


The demo tests the JSMathToolkit Axis class (yes, I use the term loosely). The supporting code in the demo is actually a pretty general-purpose zoomable and pannable numberline. That numberline will be re-written into a standalone Angular 2 Component in the new library.

Here is the remainder of the package structure and current JS ‘classes.’


- clockTimeModel.js

- fractionModel.js


- AStar.js

- AStarTiles.js

- AStarWaypoint.js

- Grid2d.js

- TileNode.js


- ArcTo.js

- ArrowedArc.js

- CircularArc.js

- Crescent.js

- CSection.js

- CurvedArrow.js

- EllipticalArc.js

- Endcap.js

- Heart.js

- ModifiedReuleauxTriangle.js

- Pill.js

- Teardrop.js

- Wedge.js



    - DashedLineDecorator.js

    - DottedLineDecorator.js

    - SolidLineDecorator.js


    - DenseArray

    - Graph.js

    - GraphArc.js

    - GraphArcIterator.js

    - Graphiterator.js

    - GraphNode.js

    - HeapIterator.js

    - NodeValueIterator.js

    - PriorityQueue.js

- Coordinate.js

- GraphDatamarker.js

- GraphMarker.js

- GraphSlice.js

- GridView.js

- Limits.js

- Point.js

- RectangleSelector.js

- RenderDrawStack.js



    - ComplexStepFunction.js

    - StepFunction.js

    - IntervalData.js

    - Polynomial.js

    - AbsValue.js

    - ScatterPlot.js

    - PolynomialInterp.js

- GraphLayer.js

- FcnGraphEngine.js

- FunctionParser.js


- McMaster.js

- Lang.js

- ConvexHull.js

- DouglasPeucker.js


- GraphAxis.js

- Axis.js



    - Back.js

    - Bounce.js

    - Cubic.js

    - Elastic.js

    - Exponential.js

    - Linear.js

    - Quadratic.js

- CubicRoots.js

- Derivative.js

- Deviates.js

- Matrix.js

- Neville.js

- PrimeFactorization.js

- Quaternion.js

- RandomInRange.js

- SeededRng.js


- CubicBezier.js

- Line.js

- QuadBezier.js

- TwoPoint.js


- Arrow.js

- CSection.js

- ISection.js

- LSection.js

- Polygon.js

- RegularNgon.js

- Star.js

- Triangle.js

- ShapeConstants.js


- BounceController.js

- ConstantMotionController.js

- GravityController.js

- Motion.js

- SpringNode.js

- TwoPointSpring.js

- WindController.js


- BezierSplineControl.js

- CatmullRom.js

- CubicBezierSpline.js

- NaturalCubicSpline.js

- QuadBezierSpline.js

- SplineToBezier.js



    - TTests.js

    - llsq.js

    - Bagging.js

    - bllsq.js

    - Table.js

    - Bayes.js

    - FrequencyTable.js

- DataStats.js

- BinomialCoef.js

- Normal.js

- Binomial.js

- Poisson.js

- Chi2.js


- ApproxEqual.js

- BezierUtils.js

- CircleUtils.js

- CurveUtils.js

- Gauss.js

- GeomUtils.js

- Halley.js

- MathUtils.js

- Newton.js

- NumberFormatter.js

- PointUtils.js

- PolygonUtils.js

- QuadArea.js

- Solve2x2.js

- TWBRF.js

Currently, there are almost 1,200 individual methods in the toolkit, with more to come for a V1.0 release.

Every .js file will be re-coded in Typescript. All demos will be overhauled into a well-structured Angular 2 architecture. The statistics package needs some internal work and some new methods will be added into the dataanalysis folder. The kinematics package (forward and inverse) has not yet been written. That will be part of the first release.

I can’t really comment on roadmap as this is not a funded project.  I am grateful for the people who have come forward and offered to help and without that help, this project would not be possible.  All I can offer is to check this blog regularly to keep up with progress.


Comments are closed.