This commit is contained in:
SilicoFlare
2023-03-24 20:55:35 +05:30
committed by GitHub
parent f7c37e803b
commit b9b4802751
2 changed files with 26 additions and 11 deletions

12
_temp/blank.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blank Page</title>
</head>
<body>
</body>
</html>

View File

@@ -48,6 +48,7 @@
</form> </form>
<br><br> <br><br>
<h3>Copy your code from here:</h3> <h3>Copy your code from here:</h3>
<button type="button" onclick="copy"
<div id="code"> <div id="code">
Enter all values and click 'Submit' Enter all values and click 'Submit'
</div> </div>
@@ -57,7 +58,8 @@
<script> <script>
var count = 0 var count = 0
var finalCode = ""
function delValue(num) { function delValue(num) {
var divi = document.getElementById("value"+num); var divi = document.getElementById("value"+num);
divi.remove(); divi.remove();
@@ -99,9 +101,9 @@
codeArea = document.getElementById("code"); codeArea = document.getElementById("code");
startX = document.getElementById("value0").querySelector(".fld1").value; startX = document.getElementById("value0").querySelector(".fld1").value;
endX = document.getElementById("value"+(count-1)).querySelector(".fld1").value; endX = document.getElementById("value"+(count-1)).querySelector(".fld1").value;
codeArea.innerText = "x = "+startX+":"+(endX-startX)/(count-1)+":"+endX+";"; finalCode = "x = "+startX+":"+(endX-startX)/(count-1)+":"+endX+";";
codeArea.innerText += "\nx = x';" finalCode += "\nx = x';"
var ySTR = "y = [" var ySTR = "y = ["
for(i=0;i<count;i++) { for(i=0;i<count;i++) {
@@ -110,21 +112,21 @@
if(i!=(count-1)) if(i!=(count-1))
ySTR+=";" ySTR+=";"
} }
codeArea.innerText += "\n"+ySTR+"]"; finalCode += "\n"+ySTR+"]";
codeArea.innerText += "\nplot(x,y)"+ finalCode += "\nplot(x,y)"+
"\nxlabel('$Volume\\ of\\ $K_{2}Cr_{2}O_{7}$\\ added\\ in\\ mL$')"+ "\nxlabel('$Volume\\ of\\ $K_{2}Cr_{2}O_{7}$\\ added\\ in\\ mL$')"+
"\nylabel('$Potential\\ (E)\\ in\\ mV$')"+ "\nylabel('$Potential\\ (E)\\ in\\ mV$')"+
"\nxgrid()"; "\nxgrid()";
codeArea.innerText += "\nxstring(5.5, 450, ['Name: "+document.getElementById("stuName").value+"'])"; finalCode += "\nxstring(5.5, 450, ['Name: "+document.getElementById("stuName").value+"'])";
codeArea.innerText += "\nxstring(5.5, 425, ['SRN: "+document.getElementById("srn").value+"'])"; finalCode += "\nxstring(5.5, 425, ['SRN: "+document.getElementById("srn").value+"'])";
codeArea.innerText += "\nxstring(0.8, 850, ['SCALE'])"+ finalCode += "\nxstring(0.8, 850, ['SCALE'])"+
"\nxstring(0.5, 825, ['X-AXIS: 0.5 mL'])"+ "\nxstring(0.5, 825, ['X-AXIS: 0.5 mL'])"+
"\nxstring(0.6, 800, ['Y-AXIS: 50 V'])"; "\nxstring(0.6, 800, ['Y-AXIS: 50 V'])";
codeArea.innerText += "\nscf"+ finalCode += "\nscf"+
"\nN = length(x)"+ "\nN = length(x)"+
"\ndydx = diff(y(:)) ./ diff(x(:))"+ "\ndydx = diff(y(:)) ./ diff(x(:))"+
"\ndydx(N) = dydx(N-1)"+ "\ndydx(N) = dydx(N-1)"+
@@ -137,8 +139,9 @@
"\nxstring(0.5, 525, ['X-AXIS: 0.5 mL'])"+ "\nxstring(0.5, 525, ['X-AXIS: 0.5 mL'])"+
"\nxstring(0.49, 500, ['Y-AXIS: 50 units'])"; "\nxstring(0.49, 500, ['Y-AXIS: 50 units'])";
codeArea.innerText += "\nxstring(5.5, 550, ['Name: "+document.getElementById("stuName").value+"'])"; finalCode += "\nxstring(5.5, 550, ['Name: "+document.getElementById("stuName").value+"'])";
codeArea.innerText += "\nxstring(5.5, 525, ['SRN: "+document.getElementById("srn").value+"'])"; finalCode += "\nxstring(5.5, 525, ['SRN: "+document.getElementById("srn").value+"'])";
codeArea.innerText = finalCode;
} }
</script> </script>
</body> </body>