Debian Codegraph @

examples/mathML.xhtml

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 <?xml version="1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
3 "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
4 <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
5 ]>
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <title>JSXGraph example</title>
9 <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
10 <script type="text/javascript" src="prototype.js"></script>
11 <script type="text/javascript" src="../distrib/loadjsxgraphXML.js"></script>
12 <script type="text/javascript" src="../distrib/jxg.js"></script>
13 <script type="text/javascript" src="../distrib/SVGRendererMinify.js"></script>
14 </head>
15 <body>
16 <h2>MathML example</h2>
17 <div id="jxgbox" class="jxgbox" style="width:700px; height:500px;"></div>
18 <div id="debug" style="position:relative; display:none; width:600px; height:100px; border:1px dashed black; background-color:white;"></div>
19 <script type="text/javascript">
20 /* <![CDATA[ */
21
22 board = JXG.JSXGraph.initBoard('jxgbox', {originX: 50, originY: 250, unitX: 40, unitY: 20});
23 // Slider-Makro
24 function createSlider(board,parents,atts) {
25 var sx = parents[0];
26 var sy = parents[1];
27 var sw = parents[2];
28 var smin = parents[3];
29 var smax = parents[4];
30 var p1 = board.createElement('point', [sx, sy], {visible:false, fixed:true});
31 var p2 = board.createElement('point', [sx + sw, sy],{visible:false,fixed:true});
32 var l1 = board.createElement('line', [p1,p2], {straightFirst:false,straightLast:false,strokewidth:1});
33 //
34 var ticks = 10;
35 for(i = 0; i < ticks+1; i++) {
36 var t1 = board.createElement('point', [sx + i*sw/ticks, sy - 0.25 + i%2*0.1], {visible:false, fixed:true});
37 var t2 = board.createElement('point', [sx + i*sw/ticks, sy + 0.25 - i%2*0.1], {visible:false, fixed:true});
38 var tt = board.createElement('line', [t1,t2], {straightFirst:false,straightLast:false,strokewidth:2-i%2});
39 }
40 var p3 = board.createElement('point', [sx + sw/2, sy], {slideObject:l1,style:6,strokeColor:'#0080c0',fillColor:'#0080c0',name:' '});
41 var p4 = board.createElement('point', [function() {return ((p3.X() - sx)/sw * (smax - smin) -smax);}, function() {return (sy + 1);}], {visible:false, name:'xxx'});
42 var l2 = board.createElement('line', [p1,p3], {straightFirst:false,straightLast:false,strokewidth:3,strokeColor:'#0080c0'});
43 var t = board.createElement('text', [sx+sw+0.25, sy], {text:"<value>X("+p4.name+")</value>"});
44 return p4;
45 }
46
47 var s = createSlider(board,[8,-5,5,-10,1],{name:'S'});
48 var t1 = board.createElement('text', [0,0], {text:'Test: <p><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><msqrt><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></msqrt><mn>27</mn></msup></math></p>'});
49 var t2 = board.createElement('text', [0,-1], {text:'Test'});
50
51 /* ]]> */
52 </script>
53 <p><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><msqrt><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></msqrt><mn>27</mn></msup></math></p>
54 </body>
55 </html>