Share JSXGraph: example "Draggable exponential function"

JSXGraph
Share JSXGraph: example "Draggable exponential function"
This website is a beta version. The official release will be in **2023**.

Draggable exponential function

Plot the function $$ y = e^{ax} $$ where the parameter $a$ is determined by the Point $A=(x_A, y_A)$. It follows, $$a = \log(y_A) / x_A.$$ In other words, we want to plot an exponential function through the point $A$.
// Define the id of your board in BOARDID

const board = JXG.JSXGraph.initBoard(BOARDID, {boundingbox: [-5, 20, 5, -2], axis:true});

var A = board.create('point', [1, Math.exp(1)]);
var graph = board.create('functiongraph', [
         function(x) {
             var a = Math.log(A.Y()) / A.X();
             return Math.exp(a * x);
         }]);
           
var txt = board.create('text', [-3, 10, 
        () => 'a = ' + (Math.log(A.Y()) / A.X()).toFixed(2)], 
        {fontSize: 16});