Hauptsatz der Differential- und Integralrechnung: Unterschied zwischen den Versionen
Markierung: Zurückgesetzt |
Markierung: Zurückgesetzt |
||
Zeile 42: | Zeile 42: | ||
<body> | <body> | ||
<div id="box2" style="width:15%; aspect-ratio:3/2; margin-top:20px;"></div> | <div id="box2" style="width:15%; 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', { | ||
Zeile 87: | 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); | ||
}]); | }]); | ||
// Integral erstellen | // Integral erstellen | ||
var i1 = board.create('integral', [ | var i1 = board.create('integral', [ | ||
Zeile 115: | Zeile 116: | ||
}); | }); | ||
// Integral- | // Funktion zur Aktualisierung des Integral-Labels | ||
function updateIntegralLabel() { | |||
const a = i1.baseLeft.X().toFixed(2); // Untere Grenze | const a = i1.baseLeft.X().toFixed(2); // Untere Grenze | ||
const b = i1.baseRight.X().toFixed(2); // Obere Grenze | const b = i1.baseRight.X().toFixed(2); // Obere Grenze | ||
const value = i1.Value().toFixed(4); // Wert des Integrals | const value = i1.Value().toFixed(4); // Wert des Integrals | ||
i1.label.setText(`\\[\\int_{${a}}^{${b}} f(x) \\, dx = ${value}\\]`); | |||
}); | } | ||
// Event-Listener für die Bewegung der Integralgrenzen | |||
i1.baseLeft.on('drag', updateIntegralLabel); | |||
i1.baseRight.on('drag', updateIntegralLabel); | |||
// Initiales Setzen des Labels | |||
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'], { |