File: optimization.html

package info (click to toggle)
jsxgraph 1.3.5+dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 26,044 kB
  • sloc: xml: 5,869; java: 1,072; python: 747; php: 192; makefile: 146; sh: 47
file content (60 lines) | stat: -rw-r--r-- 6,303 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<html>
<head>
   <title>JSXGraph example</title>
   <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
   <script type="text/javascript" src="/javascript/prototype/prototype.js"></script>
   <script type="text/javascript" src="../src/loadjsxgraph.js"></script>
   <script type="text/javascript" src="../src/reader/geonext.js"></script>
</head>
<body>

<h1>Optimizing a fenced area</h1>
      
      <!-- Die beiden Zeichenflaechen, schoen nebeneinander angeordnet in einer Tabelle -->
      <table border="0">
        <tr><td>
            <div id="box" class="jxgbox" style="width:500px; height:500px;"></div>
        </td><td>
            <div id="box2" class="jxgbox" style="width:500px; height:500px;"></div>
        </td></tr>
      </table>
      
      <!-- Die Tabelle mit den Werten -->
      
      <table style="border: 0px solid black; text-align: center" width="500px">
	    <tr><th style="border: 1px solid black" width="100px">Length of fence</th><th style="border: 1px solid black" width="100px">Length of side a</th><th style="border: 1px solid black" width="100px">Length of side b</th><th style="border: 1px solid black" width="100px">Area of rectangle</th></tr>
	    <tr><td id="print_fencelength">1</td><td id="print_sidelength1">2,5</td><td id="print_sidelength2">2</td><td id="print_area">3</td></tr>
      </table>

      <script type="text/javascript">
        /* <![CDATA[ */

        // Das Objekt geonext ist global und wird in Geonext.js initialisiert
        // board links oben initialisieren
        board1 = JXG.JSXGraph.loadBoardFromString('box', 'eNrtXOtv48YR/2z9FQv4S1MkFEm9UZbAXWwHQfNCcg2SokhBSStpa4oU+LClC/K/d2ZfXMpLyXIvZ59MG/Dt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C3rs2jOylyH7pI81c71XmPw/onYOUtEXaEKMQZooFmufPVh9zo4djAU9tJ6NkSMthnZM3tVwEMpzwypZFRcfftSD44NfqdCjuGFr21eeMDafNgHyYe9RC/84fJhpyCvIX1W4TEwXD1H5I0dmd7zIlM2blO1Zw9NhUeEQd1ln3hIHj/9kCwMsf2YLI5K7UH57A/Kc5shHLcH5fag/HwH5UdbP999svUbtBnC1234qMXw+W5r+FrD92yG74Tsje8fzd6MG7M3AuZt/uYc8zfuh8zffGWzkX6bv2nzNx83f2M/Jeu3zJWl/MH6RsVveqNyR7OCbmU4KIkHVfiqpbGOn6GbaoWqNNXuTXnu31cdCDRvbt7A73l8RzIFXaGZaUQXNiPa/6ENNF9XoPnwG7uGj+wOhJq2z+zskaYBQwskl3ZIei0kW0g+EyRXdkj6LSRbSD4TJJkdkr0Wki0kPwIk8UNzfcDB8474b+jVYeedazvrTBrOOurGhW9osixWeB/DgiYzSmLydxLcRXFJwyuWF3958/nbzwBfnGHc00DURQ2n9cdLHYi+1eFA36EzHJjdttV3/p7j1z7r7znu+OF3/PVP+M/3NCX048BpatjH38bTlKg+lLZ/QSmtQ5dAkAe3QJC9ayCILWNB7DdBkL2rICRYjJsgSHUVRIM+ehZ97LlH9PENYA81Ar+wj5JlTEn0QKOuPvsrL119/u1B3Xz6WHU9PTiO74yGjZrq1S8U8J3BsFXVVlWfU1XB71aXgaGD5Xc48ovEQCqwen4TXJGm8TTC/6ZCRCL9nz9d/6hz6URer0GTsnhPwUMvWMIweUf+IXKZt/z6sZiCZukXi9BrTvNZxjZ8F6LboqQx6NL0kaOYnTvikjq9yiCHh5oVdG5yEWgWdqcTTEugEn5tIyZDDbITiIDD/RvemshDj+A+Ve+/sNQRlkZsVVddkvk/CpkHvA==', 'Geonext');


        board2 = JXG.JSXGraph.initBoard('box2', {originX: 100, originY: 250, unitX: 50, unitY: 50});
        // Tracing the area
        b2p1 = board2.createElement('point', [function(){ return JXG.getReference(board1, 'A').Dist(JXG.getReference(board1, 'D')); }, function() { return JXG.getReference(board1, 'A').Dist(JXG.getReference(board1, 'D'))*JXG.getReference(board1, 'D').Dist(JXG.getReference(board1, 'M')); }], {fixed: true, trace: true, strokeColor: '#ff0000', name: 'S'});

        b2axisx = board2.createElement('axis', [[0,0], [1,0]], {});
        b2axisy = board2.createElement('axis', [[0,0], [0,1]], {});


        board1.addChild(board2);
		//defining the hook
		function print_table() {
            $('print_fencelength').innerHTML = Math.round(JXG.getReference(board1, 'A').Dist(JXG.getReference(board1, 'B')),2);
            $('print_sidelength1').innerHTML = Math.round(JXG.getReference(board1, 'A').Dist(JXG.getReference(board1, 'D')),2);
            $('print_sidelength2').innerHTML = Math.round(JXG.getReference(board1, 'M').Dist(JXG.getReference(board1, 'D')),2);
            $('print_area').innerHTML = Math.round(JXG.getReference(board1, 'A').Dist(JXG.getReference(board1, 'D')) * JXG.getReference(board1, 'M').Dist(JXG.getReference(board1, 'D')),2);


        }
        //registering the hook
        print_table_id = board1.addHook(print_table);

    </script>
</body>
</html>