For years, I’ve wanted to think about using content MathML and SVG to plot a
y = f(x) function on a pair of axes. The SVG part of this is not too hard (alas, I lost every copy of my SVG grapher years ago, and will have to rewrite it), but MathML is a whole different ball of wax.
Pretty cool, huh? It doesn’t cover all of MathML, not by a long shot. It’s a starting point, for the most basic of functions in MathML (specifically, those covered by ECMAScript’s
Math object, and basic arithmetic).
I have a demo of contentMathEval.js here, and contentMathEval.js includes some internal documentation on how to use it. Most of it hasn’t been tested yet.
I don’t plan on making immediate improvements to this script, but I will take code contributions if anyone’s interested. Something more advanced (with support for my BigDecimal library, and probably derivatives and integrals) I will probably tackle at a future date.