-
Notifications
You must be signed in to change notification settings - Fork 0
/
projet.html
25 lines (25 loc) · 951 Bytes
/
projet.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<title>Projet 2014 Hybrid & Bloem</title>
<meta charset="utf-8">
<style></style>
</head>
<body>
<div id="box" class="jxgbox" style="width:500px; height:500px;"></div>
<script type="text/javascript">
function grapher(){
var board = JXG.JSXGraph.initBoard('box', {boundingbox: [-10, 10, 10, -10], axis:true});
eval("function f(x){ return "+document.getElementById("myform").maFonction.value+";}");
board.create('functiongraph',[function(x){ return f(x); }]);
}
</script>
<html>
<form id="myform">
<input type="text" name="maFonction" id="maFonction" /><br>
<!-- utiliser regex pour transformer x^3 en x*x*x -->
</form>
<button onclick="grapher()">Click me</button>
</body>
</html>