Draggable exponential function

From JSXGraph Wiki
Revision as of 09:32, 16 February 2016 by A WASSERMANN (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Plot the function y = e^{ax} where the parameter a is determined by the Point A=(x_A, x_Y).


The JavaScript code

var board = JXG.JSXGraph.initBoard('box1', {boundingbox: [-5, 20, 5, -1], axis:true});

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