Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lab/exp1/simulation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link rel="stylesheet" href="q bootstrap-3.1.1-dist/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="q bootstrap-3.1.1-dist/css/bootstrap.min.css" media="screen">
<link rel="stylesheet" type="text/css" href="../../style.css">
<!-- <link rel="stylesheet" type="text/css" href="../../bstyle.css"> -->
<!-- <link rel="stylesheet" type="text/css" href="../../fonts.css"> -->
Expand Down Expand Up @@ -48,15 +48,15 @@
<div id = 'NumApproCodeContent3' >&emsp;&emsp;&emsp;double sum;</div>
<div id = 'NumApproCodeContent4' >&emsp;&emsp;&emsp;scanf("%d%d", &a, &b );</div>
<div id = 'NumApproCodeContent5' >&emsp;&emsp;&emsp;sum = 0; width = 1; i = 0;</div>
<div id = 'NumApproCodeContent6' >&emsp;&emsp;&emsp;for ( i = a; b >= i; i += width){</div>
<div id = 'NumApproCodeContent6' >&emsp;&emsp;&emsp;for ( i = a; b > i; i += width){</div>
<div id = 'NumApproCodeContent7' >&emsp;&emsp;&emsp;&emsp;&emsp;sum = sum + cos(2*Pi/13*i) * width;</div>
<div id = 'NumApproCodeContent8' >&emsp;&emsp;&emsp;}</div>
<div id = 'NumApproCodeContent9' >&emsp;&emsp;&emsp;printf("Integration value = %d", sum);</div>
<div id = 'NumApproCodeContent10' >}</div>
</div><!-- end of programCode -->
</div><!-- end of stepExecutionDisplay -->
</div><!-- end of executionDivision -->
<div class = 'outputDivision' >
<div class = 'outputDivision' >
<div class = 'outputDivisionTitle' ><div class = 'outputPic' ></div><div class = 'outputText' >Graph Visualization</div></div>
<div class = 'resultDisplay' id = 'resultDisplay' >
<div class = 'graph'>
Expand Down
2 changes: 1 addition & 1 deletion src/lab/exp1/simulation/numericalApproximation.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ window.view = {
model.incrementInWidth();
this.sum = Math.round(model.sum * 100) / 100;
this.setInnerHtml('valuesum', this.sum);
this.setInnerHtml('valuei', model.inputValueA);
this.setInnerHtml('valuei', model.inputValueA-1);
},
// calculateXCoordinates: compute starting position of xCoordinatesValue on x-axis.
calculateXCoordinates: function () {
Expand Down