Hauptsatz der Differential- und Integralrechnung: Unterschied zwischen den Versionen
| Zeile 37: | Zeile 37: | ||
<head> | <head> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraphcore.js"></script> | <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 | <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" /> | <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraph.css" /> | ||
</head> | </head> | ||
<body> | <body> | ||
<div id="box2" style="width: | <div id="box2" style="width:20%; 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; | ||
// Zweites JSXGraph-Board | |||
var board = JXG.JSXGraph.initBoard('box2', { | var board = JXG.JSXGraph.initBoard('box2', { // Korrektur: 'box2' statt 'divid' | ||
boundingbox: [-5, 5, 8, -5], | boundingbox: [-5, 5, 8, -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: { | |||
x: { | |||
withLabel: true, | |||
name: 't', | |||
label: { | |||
position: 'rt', | |||
offset: [-5, 15], | |||
fontSize: 16, | |||
anchorX: 'right' | |||
}, | |||
ticks: { | |||
ticksDistance: 1, | |||
minorTicks: 0 | |||
} | |||
}, | |||
y: { | |||
withLabel: true, | |||
name: 'f(t)', | |||
label: { | |||
position: 'rt', | |||
offset: [15, 5], | |||
fontSize: 16, | |||
anchorY: 'right' | |||
}, | |||
ticks: { | |||
ticksDistance: 1, | |||
minorTicks: 0 | |||
} | |||
} | |||
} | |||
}); | }); | ||
| Zeile 64: | Zeile 92: | ||
[-2.0, 2.0], c1 | [-2.0, 2.0], c1 | ||
], { | ], { | ||
withLabel: false, | withLabel: true, | ||
baseLeft: { visible: true, fixed: false, withLabel: true, name: 'a' }, | label: { | ||
baseRight: { visible: true, fixed: false, withLabel: true, name: 'b' } | fontSize: 16, | ||
offset: [0, 50], | |||
digits: 4, | |||
intl: { | |||
enabled: false, | |||
options: {} | |||
} | |||
}, | |||
baseLeft: { // Start point | |||
visible: true, | |||
fixed: false, | |||
withLabel: true, | |||
name: 'a' | |||
}, | |||
baseRight: { // End point | |||
visible: true, | |||
fixed: false, | |||
withLabel: true, | |||
name: 'b' | |||
} | |||
}); | |||
//document.getElementById('output').value = integral.Value() + ' ' + integral.label.plaintext; | |||
// Integral-Label anpassen | |||
i1.label.setText(() => { | |||
const a = i1.baseLeft.X().toFixed(2); // Untere Grenze | |||
const b = i1.baseRight.X().toFixed(2); // Obere Grenze | |||
const value = i1.Value().toFixed(4); // Wert des Integrals | |||
return \\[\\int_{${a}}^{${b}} f(t) \\, dt = ${value}\\]; | |||
}); | |||
// Beschriftung der Funktion mit f | |||
board.create('text', [3.5, 3, 'f'], { | |||
fontSize: 16, | |||
fixed: true, | |||
anchorX: 'left', | |||
anchorY: 'bottom', | |||
color: 'blue' | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||