-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
77 lines (66 loc) · 3.36 KB
/
index.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<title>MCM3 a Monte Carlo method Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="author" content="Claus Schabetsberger, Markus Zimmermann"/>
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"/>
<script type="text/javascript" src="js/lib/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/lib/d3-2.9.6.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<link href="css/lib/bootstrap-2.0.3.min.css" rel="stylesheet">
<link href="css/index.css" rel="stylesheet">
<script type="text/javascript">
$(function() {
// setup our event handlers
setup();
// execute the Monte Carlo method right on startup
$('#function_execute').click();
});
</script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<span class="brand"><a href="https://github.com/kg6/MCM3">MCM3</a> by <a href="mailto:[email protected]">Claus Schabetsberger</a> and <a href="mailto:[email protected]">Markus Zimmermann</a></span>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3 sidebar">
<p><span class="label label-info">Info</span> We directly use JavaScript to define the drawn function. Please have a look at this <a href="https://developer.mozilla.org/en/JavaScript/Reference">reference</a> if you are not familiar with the mathematical <a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence">operators</a> or <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Math/">functions</a> of JavaScript. You can also use logic in your function as you can see in the last sample function (bandpass).</p>
<p>Always remember "with great power comes great responsibility" and do not forget to have fun :-)</p>
<form class="well">
<label>Sample mathematical functions:</label>
<select id="function_samples">
<option>Math.sin(x / 100)</option>
<option>-x * x + 10 * x - 10</option>
<option>(x - 350)*(x - 350) * Math.cos(x / 100) * -1 * Math.sin(x / 100)</option>
<option>Math.sin(Math.pow(x, Math.E) / (1500 * 1500))</option>
<option>Math.abs(x - 350)</option>
<option>Math.abs(x - 350) * Math.sin(x / 100)</option>
<option>function(){
var bandPass = 0.3
var y = Math.sin(x / 30);
return (y > bandPass) ? bandPass : (y < -bandPass) ? -bandPass : y;
}()</option>
</select>
<label>Current mathematical function:</label>
<textarea id="function_definition" rows="10">Math.sin(x / 100)</textarea><br/>
<label>Number of samples:</label>
<input id="samples_count" type="text" value="1000"><br/>
<label class="checkbox"><input id="use_random_org" type="checkbox" value="1"/> Use random numbers from <a href="http://random.org">random.org</a></label>
<span class="help-block"><span class="label label-important">Important</span> This service has a quota of about 1.000.000 numbers per IP address!</span>
<button id="function_execute" class="btn btn-success">DRAW and EXECUTE the<br/>Monte Carlo method!!!</button>
</form>
</div>
<div class="span8 content">
<div id="canvas"></div>
<div id="results" class="well"></div>
</div>
</div>
</div>
</body>
</html>