Code:
<form name="MyForm"> Min X = <input name="LowXField" size="5" value="-1" type="text"> Max X = <input name="HighXField" size="5" value="9" type="text"> Min Y = <input name="LowYField" size="5" value="-2" type="text"> Max Y = <input name="HighYField" size="5" value="5" type="text"> <input value="Afficher la fenêtre" onclick="setView()" type="button">
<p> f(x) = <input name="FunctionField" size="30" value=" "> <input value="Graphique" onclick="setFunction()" type="button"> <p> f(x) = <select name="ExampleSelect"> <option value="">Exemples</option> <option value="sin(2 x) - 1 / 10 x^2 + 3">sin(2 x) - 1 / 10 x^2 + 3</option> <option value="2 + cos(x/2)">2 + cos(x/2)</option>
<option value="x^2 / 20">x^2 / 20</option> <option value="ln(x)">ln(x)</option> <option value="sqrt(x)">sqrt(x)</option> <option value="cbrt(x)">cbrt(x)</option> </select> <input value="Charger l'exemple" onclick="exampleLoader()" type="button"> <p>
Paramètres de la somme: a = <input name="A" size="5" value="1" type="text"> b = <input name="B" size="5" value="7" type="text"> Nombre de rectangles n = <input name="N" size="5" value="12" type="text"> <input value="Valider" onclick="setRiemann()" type="button"> </form> <script type="text/javascript"> function setView() { var applet = document.ggbApplet; var LowX = document.MyForm.LowXField.value; var HighX = document.MyForm.HighXField.value; var LowY = document.MyForm.LowYField.value; var HighY = document.MyForm.HighYField.value; applet.setCoordSystem(LowX, HighX, LowY, HighY); } function setFunction() { var applet = document.ggbApplet; var func = "f(x) = " + document.MyForm.FunctionField.value; applet.evalCommand(func); } function exampleLoader() { var func = document.MyForm.ExampleSelect.value; if (func != "") { document.MyForm.FunctionField.value = func; setFunction(); } } function setRiemann() { var applet = document.ggbApplet; var a = document.MyForm.A.value var b = document.MyForm.B.value var n = document.MyForm.N.value applet.evalCommand("a = " + a); applet.evalCommand("b = " + b); applet.evalCommand("n = " + n); } </script>
Aucun commentaire:
Enregistrer un commentaire