Open stardust66 opened 7 years ago
Cool find.
For reference, Math3D uses MathJS for parsing and compiling string representations of mathematical objects: http://mathjs.org/docs/expressions/parsing.html. A mathematical expression is parsed into a tree which can then be evaluated.
Actually, Math3D does a bit of pre-processing before passing the string to MathJS. The reason is to support functions like diff
:
In Math3D
=========
f is a function
diff is a function
diff(f) returns a new function, namely the derivative of f
diff(f)(t) means "derivative evaluated at point t"
but MathJS gets confused by diff(f)(t)
, thinking diff(f)
and (t)
are numbers that should be multiplied.
I suspect this MathJS approach is pretty slow compared to Desmos. However, we get all sorts of things for free like vectors and Matrices, which Desmos does not support (at the time of writing).
A long term optimization goal.
For reference, here's the pipeline for Desmos (from https://news.ycombinator.com/item?id=11369540):