Hauptsatz der Differential- und Integralrechnung: Unterschied zwischen den Versionen

Markierung: Zurückgesetzt
Markierung: Manuelle Zurücksetzung
Zeile 35: Zeile 35:


<html>
<html>
<div id="box2" style="width:25%; aspect-ratio:3/2; margin-top:20px;"></div>
<head>
     <div id="latex-output" style="margin: 20px;"></div>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraphcore.js"></script>
    <script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js" id="MathJax-script"></script>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraph.css" />
</head>
<body>
     <div id="box2" style="width:25%; aspect-ratio:3/2; margin-top:20px;"></div>
     <script type="text/javascript">
     <script type="text/javascript">
         JXG.Options.text.useMathJax = true;       
         JXG.Options.text.useMathJax = true;       
         // JSXGraph-Board erstellen
         // JSXGraph-Board erstellen
         var board = JXG.JSXGraph.initBoard('box2', {
         var board = JXG.JSXGraph.initBoard('box2', {
             boundingbox: [-5, 5, 10, -5],
             boundingbox: [-5, 5, 10, -5], // Angepasste Boundingbox für die Skalierung
             axis: true,
             axis: true,
             showCopyright: false,
             showCopyright: false,
             showNavigation: true,
             showNavigation: true,
             grid: true,
             grid: true, // Gitternetz aktivieren
             defaultAxes: {
             defaultAxes: {
                 x: {
                 x: {
Zeile 82: Zeile 87:
             return (Math.pow(t, 5) / 24 - Math.pow(t, 3) / 2 + t);
             return (Math.pow(t, 5) / 24 - Math.pow(t, 3) / 2 + t);
         }]);
         }]);
        // Create output div for LaTeX
        const latexOutput = document.getElementById('latex-output');
        // Function to update LaTeX display
        function updateLatexDisplay(a, b, value) {
            const latexString = `\\[\\int_{${a}}^{${b}} f(x) \\, dx = ${value}\\]`;
            latexOutput.innerHTML = latexString;
            if (window.MathJax) {
                MathJax.typesetPromise([latexOutput]);
            }
        }


         // Integral erstellen
         // Integral erstellen
Zeile 99: Zeile 92:
             [-2.0, 2.0], c1
             [-2.0, 2.0], c1
         ], {
         ], {
             withLabel: false, // We'll display the label separately
             withLabel: true,
             baseLeft: {
            label: {
                fontSize: 16,
                offset: [0, 50],
                digits: 4,
                intl: {
                    enabled: false,
                    options: {}
                }
            },
             baseLeft: {   // Start point
                 visible: true,
                 visible: true,
                 fixed: false,
                 fixed: false,
Zeile 106: Zeile 108:
                 name: 'a'
                 name: 'a'
             },
             },
             baseRight: {
             baseRight: {   // End point
                 visible: true,
                 visible: true,
                 fixed: false,
                 fixed: false,
Zeile 114: Zeile 116:
         });
         });


         // Update the LaTeX display whenever the integral changes
         // Integral-Label anpassen
         board.on('update', function() {
         i1.label.setText(() => {
             const a = i1.baseLeft.X().toFixed(2);
             const a = i1.baseLeft.X().toFixed(2); // Untere Grenze
             const b = i1.baseRight.X().toFixed(2);
             const b = i1.baseRight.X().toFixed(2); // Obere Grenze
             const value = i1.Value().toFixed(4);
             const value = i1.Value().toFixed(4); // Wert des Integrals
             updateLatexDisplay(a, b, value);
             return `\\[\\int_{${a}}^{${b}} f(x) \\, dx = ${value}\\]`;
         });
         });


Zeile 130: Zeile 132:
             color: 'blue'
             color: 'blue'
         });
         });
        // Initial update of the LaTeX display
        const initialA = i1.baseLeft.X().toFixed(2);
        const initialB = i1.baseRight.X().toFixed(2);
        const initialValue = i1.Value().toFixed(4);
        updateLatexDisplay(initialA, initialB, initialValue);
     </script>
     </script>
</body>
</html>
</html>