Hauptsatz der Differential- und Integralrechnung: Unterschied zwischen den Versionen
Markierung: Zurückgesetzt |
Markierung: Zurückgesetzt |
||
| Zeile 154: | Zeile 154: | ||
color: 'blue' | color: 'blue' | ||
}); | }); | ||
const labelElement = document.createElement('div'); | |||
labelElement.id = 'integral-label'; | |||
document.body.appendChild(labelElement); | |||
const updateLabel = () => { | |||
const a = i1.baseLeft.X().toFixed(2); | |||
const b = i1.baseRight.X().toFixed(2); | |||
const value = i1.Value().toFixed(4); | |||
labelElement.innerHTML = `\\[\\int_{${a}}^{${b}} f(x) \\, dx = ${value}\\]`; | |||
MathJax.typesetPromise(); | |||
}; | |||
i1.baseLeft.on('drag', updateLabel); | |||
i1.baseRight.on('drag', updateLabel); | |||
// Initiales Rendern | |||
updateLabel(); | |||
</script> | </script> | ||
</body> | </body> | ||