File: mathjax.html

package info (click to toggle)
jsxgraph 1.3.5+dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 26,044 kB
  • sloc: xml: 5,869; java: 1,072; python: 747; php: 192; makefile: 146; sh: 47
file content (30 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
    <title>JSXGraph example</title>
    <script type="text/javascript" src="/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
    <script type="text/javascript" src="../src/loadjsxgraph.js"></script>
</head>
<body>
<h1>MathJax</h1>
<div id='jxgbox' class='jxgbox' style='width:600px; height:600px;'></div>
<script type='text/javascript'>
    var brd, k;
    JXG.Options.text.useMathJax = true;
    brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,20,5,-5], axis:true, showNavigation:true, showCopyright:true});
    k = brd.create('slider',[[-4,-2],[3,-2],[-5,1,5]],{name:'n', snapWidth:1});
    brd.create('functiongraph', [function(t) {return Math.pow(Math.E,t*k.Value());}],{strokeColor:'#ff0000'});
    brd.create('text',[-4,15,
      function() { 
        var temp;
        if (k.Value() == 1) {
          temp = '\\[f(x) = e^x \\]'; 
        } else {
          temp = '\\[f(x) = e^{' + k.Value() + 'x}\\]';
        }
       return temp;
     }], {fontSize:60});
    brd.update();
</script> 
</body>
</html>