Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make_function_plotter uses Numbas.jme.makeFast
The new implicitcurve object in JSXGraph 1.7.0 needs to evaluate its function thousands of times for each update. It became clear that the standard way of evaluating JME expressions is far too slow, so I wrote `Numbas.jme.makeFast` to turn most expressions into almost-native JS functions. This commit changes the `make_function_plotter` code, which is used whenever you use a subexpression as a parameter in a JSXGraph diagram, to use `Numbas.jme.makeFast`. It also makes `make_function_plotter` pick up the names of objects already defined in the board, so you can use the values of things like sliders in expressions. If an object in the board has a `.Value` method, then you can use its value by referring to it by its ID in the expression. Example: jsxgraph(400,400, [-4,4,4,-4], [ "a": ["slider", [[-3.5,2.5],[-1.5,2.5],[0,1,3]], ["id": "a"]], "f": ["implicitcurve", [expression("x^2-y^2-a")], ["id": "f"]] ])
- Loading branch information