HACKER Q&A
📣 the-mitr

What packages can be used to create interactive mathematics simulations?


I would like to explore the different libraries which can create mathematics simulations that are renderable on a webpage. Though I have used geogebra in the past, I would like to know what other options are available to create interactive simulations in basic algebra and geometry. I have seen Cinderella and Dr. Geo but would like to explore more options which can be customised.


  👤 mindcrime Accepted Answer ✓
Well, MathML[1] support is (nearly) everywhere now, and as the docs say:

MathML Core is a subset with increased implementation details based on rules from LaTeX and the Open Font Format. It is tailored for browsers and designed specifically to work well with other web standards including HTML, CSS, DOM, JavaScript.

I don't have a lot of experience working with this stuff (yet) but if you can script your MathML objects with Javascript, you should be able to make whatever interactive "stuff" you want in terms of math notation.

Now drawing objects and plots and stuff is a different question. There's stuff like Plotly.js[2], D3.js[3], Sigma.js[4], Three.js[5], Two.js[6], Paper.js[7], etc. that might be useful depending on exactly what effects you're going for.

[1]: https://developer.mozilla.org/en-US/docs/Web/MathML

[2]: https://github.com/plotly/plotly.js

[3]: https://d3js.org/

[4]: https://www.sigmajs.org/

[5]: https://threejs.org/

[6]: https://two.js.org/

[7]: http://paperjs.org/


👤 richardjam73
I watched a video by Sebastion Lague where he mentioned the following tools https://www.manim.community/ and https://motioncanvas.io/

Manim is a python library, Motion Canvas is Typescript and uses Canvas


👤 tornato7
Just use HTML5 Canvas. Ask GPT-4 to set up the basic scene for you and you'll be up and running in minutes. ciechanow.ski uses pure Canvas for all his demos.