Christian Lawson-Perfect<p>There's a new release of <a href="https://mathstodon.xyz/tags/JSXGraph" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>JSXGraph</span></a> - <a href="https://jsxgraph.org/wp/2024-01-26-release-of-version-1.7.0/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">jsxgraph.org/wp/2024-01-26-rel</span><span class="invisible">ease-of-version-1.7.0/</span></a>.<br>Among other things, it adds an 'implicit curve' object.</p><p>I thought I'd try it out in <span class="h-card" translate="no"><a href="https://mathstodon.xyz/@numbas" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>numbas</span></a></span>, then realised that the way Numbas evaluates expressions is far too slow for this kind of numerical approximation - it does a lot of dynamic type-checking that takes a long time.</p><p>So I nerdsniped myself into writing a routine to take a Numbas JME expression and make a function which is as close to native JS as I can get. It works on all of the operations that you'd expect a student to use, since those have plain-JS implementations. There's just the control flow stuff and things to do with collections that need the whole JME system.</p><p>And now that I've done that, I have a nice, real-time interactive function plotter! <br>I've made a demo question at <a href="https://numbas.mathcentre.ac.uk/question/152679/give-a-function-defining-an-implicit-curve/preview/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">numbas.mathcentre.ac.uk/questi</span><span class="invisible">on/152679/give-a-function-defining-an-implicit-curve/preview/</span></a></p><p>It's really simple to implement in Numbas: you set up a JSXGraph diagram, and fill in the function parameter of the implicit curve object with the expression the student typed. Just a few lines of code. Nice!</p>