Hauptsatz der Differential- und Integralrechnung: Unterschied zwischen den Versionen
Markierung: Zurückgesetzt |
Markierung: Zurückgesetzt |
||
| Zeile 44: | Zeile 44: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
JXG.Options.text.useMathJax = true; | JXG.Options.text.useMathJax = true; | ||
var board = JXG.JSXGraph.initBoard('box2', { | |||
var board = JXG.JSXGraph.initBoard('box2', { | boundingbox: [-5, 5, 8, -5], | ||
boundingbox: [-5, 5, 8, -5], | |||
axis: true, | axis: true, | ||
showCopyright: false, | showCopyright: false, | ||
showNavigation: true, | showNavigation: true, | ||
grid: true, | grid: true, | ||
defaultAxes: { | defaultAxes: { | ||
x: { | x: { | ||
| Zeile 97: | Zeile 96: | ||
offset: [0, 50], | offset: [0, 50], | ||
digits: 4, | digits: 4, | ||
intl: { | intl: { enabled: false } | ||
}, | }, | ||
baseLeft: { | baseLeft: { visible: true, fixed: false, withLabel: true, name: 'a' }, | ||
baseRight: { visible: true, fixed: false, withLabel: true, name: 'b' } | |||
baseRight: { | |||
}); | }); | ||
// Funktion zum Aktualisieren des Labels mit MathJax-Neurendering | |||
function updateIntegralLabel() { | function updateIntegralLabel() { | ||
const a = i1.baseLeft.X().toFixed(2); | const a = i1.baseLeft.X().toFixed(2); | ||
const b = i1.baseRight.X().toFixed(2); | const b = i1.baseRight.X().toFixed(2); | ||
const value = i1.Value().toFixed(4); | const value = i1.Value().toFixed(4); | ||
i1.label.setText(`\\[\\int_{${a}}^{${b}} f(t) \\, dt = ${value}\\]`); | i1.label.setText(`\\[\\int_{${a}}^{${b}} f(t) \\, dt = ${value}\\]`); | ||
MathJax.typesetPromise(); // MathJax erneut rendern | |||
} | |||
// Event-Listener für die Endpunkte des Integrals | |||
i1.baseLeft.on('drag', updateIntegralLabel); | i1.baseLeft.on('drag', updateIntegralLabel); | ||
i1.baseRight.on('drag', updateIntegralLabel); | i1.baseRight.on('drag', updateIntegralLabel); | ||
// Erstes Rendern | // Erstes Rendern | ||
updateIntegralLabel(); | updateIntegralLabel(); | ||
// Beschriftung der Funktion mit f | // Beschriftung der Funktion mit f | ||
board.create('text', [3.5, 3, 'f'], { | board.create('text', [3.5, 3, 'f'], { | ||