Javascript Scientific Calculator
This javascript scientific calculator is used to perform mathematical operations like sin,cos,tan,log,exp,square,squareroot.You can use this calculator to make calculations.
Features
You can do mathematical operations using this calculator. This calculator is also used to find log, exp, sin, cos, tan operations and for other basic calculations. This is free javascript calculator.
Preview
Downloads
<!--Scripts by hscripts.com--> <!--More scripts @ www.hscripts.com--> <script type="text/javascript"> var temp; function w_onload() {frm.txt.value=0;var sds = document.getElementById("dum");if(sds == null){alert("You are using a free package.\n You are not allowed to remove the copyright.\n"); document.getElementById("maindiv").style.display='none';}var sdss = document.getElementById("dumdiv");if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the copyright.\n");} } function addchar(input,character) { if(input.value == null || input.value == "0")input.value = character; else input.value += character; } function cancel_click() {frm.txt.value=0; } function sin_click(obj) {if(obj=='sin')var result=frm.txt.value;if(document.frm.deg[0].checked){result=result*Math.PI/180;frm.txt.value=Math.sin(result).toFixed(2);}if(document.frm.deg[1].checked)frm.txt.value=Math.sin(result).toFixed(2); } function cos_click(obj) {if(obj=='cos')var result=frm.txt.value;if(document.frm.deg[0].checked){result=result*Math.PI/180;frm.txt.value=Math.cos(result).toFixed(2);}if(document.frm.deg[1].checked)frm.txt.value=Math.cos(frm.txt.value); } function tan_click(obj) {if(obj=='tan')var result=frm.txt.value;if(document.frm.deg[0].checked){result=result*Math.PI/180;frm.txt.value=Math.tan(result).toFixed(2);}if(document.frm.deg[1].checked)frm.txt.value=Math.tan(frm.txt.value); } function resi_click() {temp= frm.txt.value;frm.txt.value=1/temp; } function log_click() {frm.txt.value=Math.log(frm.txt.value)/Math.LN10; } function sqr_click() {temp=frm.txt.value;frm.txt.value=temp*temp; } function sqrt_click() {frm.txt.value=Math.sqrt(frm.txt.value); } function equal_click() {frm.txt.value=eval(frm.txt.value); } function exp_click() {frm.txt.value=Math.exp(frm.txt.value); } function fac_click() {var f=1;var i;var n=parseInt(frm.txt.value);for(i=1;i<=n;i++){f=f*i;}frm.txt.value=f; } function bks_click() {var s;s=frm.txt.value;if(s>=1){var b=s.substr(0,s.length-1);frm.txt.value=b;} } function sign_click() {if(isNaN(frm.txt.value)==false){if(frm.txt.value>0){ frm.txt.value=frm.txt.value*-1}else if(frm.txt.value<0){ frm.txt.value=frm.txt.value.replace('-','')}} } function ln_click() {frm.txt.value=Math.log(frm.txt.value); } function lb_click() {frm.txt.value=Math.log(frm.txt.value)/Math.LN2; } </script><style> input[type="button"],button,.blue_button { background:#468cd2;color: white;font-weight:bold; cursor:pointer; border-radius:.3em; -moz-border-radius:.2em; -webkit-border-radius:.2em; -o-border-radius:.2em; margin:10px 2px; border:none; } .frms {margin:0 auto; padding:10px;border-radius:.3em; -moz-border-radius:.3em;-webkit-border-radius:.3em; -o-border-radius:.3em;font-family:Tahoma, Geneva, sans-serif;color:#333;font-size:.9em; line-height:1.2em; } .frms input[type="text"],[type="password"],[type="file"],textarea,select { width:99%;background:#fff;border:#ddd 1px solid; border-radius:.35em;-moz-border-radius:.35em; -webkit-border-radius:.35em;-o-border-radius:.35em; padding:0 .5%;margin-top:5px;margin-bottom:15px; height:35px; } .frms input:hover,textarea:hover,select:hover {box-shadow:#dae1e5 0px 0px 5px;-moz-box-shadow:#dae1e5 0px 0px 5px; -webkit-box-shadow:#dae1e5 0px 0px 5px;-o-box-shadow:#dae1e5 0px 0px 5px; } .frms input:focus,textarea:focus,select:focus {-webkit-box-shadow: inset 7px 4px 7px -7px rgba(0,0,0,0.42); -moz-box-shadow: inset 7px 4px 7px -7px rgba(0,0,0,0.42); box-shadow: inset 7px 4px 7px -7px rgba(0,0,0,0.42);border:#9d9983 1px solid; } .btn { width:40px; word-wrap: normal !important; } @media screen and (max-width: 480px) { .btn { word-wrap: normal !important; width:32px; } } </style> <body onload="w_onload()"><div align='center'><h4>Scientific Calculator</h4></div> <form name="frm" class='frms noborders' action="" id='maindiv'> <center> <table> <tr><td> <input type="text" maxlength="10" class='input_text_class' name="txt" ><br /> </tr> <tr><td> <font size=1.5px><input type="radio" name=deg value="Degree">Degrees <input type="radio" name=deg value="Radian" checked>Radians <span id="dumdiv" align="center" style=" font-size: 10px;color: #dadada;"> <a id="dum" style="padding-right:0px; text-decoration:none;color: green;text-align:center;" href="https://www.hscripts.com">H</a> </span> </font> </tr> <tr><td> <input type="button" name="sqr" value="sqr" style="height:32px" onclick="sqr_click()" class='btn'> <input type="button" name="sqt" value="sqt" style="height:32px" onclick="sqrt_click()" class='btn'><input type="button" name="exp" value="exp" style="height:32px" onclick="exp_click()" class='btn'><input type="button" name="fac" value="x!" style="height:32px" onclick="fac_click()" class='btn'><input type="button" name="bks" value="bks" style="height:32px" onclick="bks_click()" class='btn'><input type="button" name="cancel" value="clr" style="height:32px" onclick="cancel_click()" class='btn'> </td></tr> <tr><td> <input type="button" name="one" value="1" style="height:32px" onclick="addchar(this.form.txt,'1')" class='btn'> <input type="button" name="two" value="2" style="height:32px" onclick="addchar(this.form.txt,'2')" class='btn'><input type="button" name="three" value="3" style="height:32px" onclick="addchar(this.form.txt,'3')" class='btn'><input type="button" name="add" value="+" style="height:32px" onclick="addchar(this.form.txt,'+')" class='btn'><input type="button" name="sin" value="sin" style="height:32px" onclick="sin_click('sin')" class='btn'> <input type="button" name="log" value="log" style="height:32px" onclick="log_click()" class='btn'> </td></tr> <tr><td> <input type="button" name="four" value="4" style="height:32px" onclick="addchar(this.form.txt,'4')" class='btn'> <input type="button" name="five" value="5" style="height:32px" onclick="addchar(this.form.txt,'5')" class='btn'><input type="button" name="six" value="6" style="height:32px" onclick="addchar(this.form.txt,'6')" class='btn'><input type="button" name="sub" value="-" style="height:32px" onclick="addchar(this.form.txt,'-')" class='btn'><input type="button" name="cos" value="cos" style="height:32px" onclick="cos_click('cos')" class='btn'> <input type="button" name="ln" value="ln" style="height:32px" onclick="ln_click()" class='btn'> </td></tr> <tr><td> <input type="button" name="seven" value="7" style="height:32px" onclick="addchar(this.form.txt,'7')" class='btn'> <input type="button" name="eight" value="8" style="height:32px" onclick="addchar(this.form.txt,'8')" class='btn'><input type="button" name="nine" value="9" style="height:32px" onclick="addchar(this.form.txt,'9')" class='btn'><input type="button" name="mul" value="*" style="height:32px" onclick="addchar(this.form.txt,'*')" class='btn'><input type="button" name="tan" value="tan" style="height:32px" onclick="tan_click('tan')" class='btn'> <input type="button" name="lb" value="lb" style="height:32px" onclick="lb_click()" class='btn'> </td></tr> <tr><td> <input type="button" name="zero" value="0" style="height:32px" onclick="addchar(this.form.txt,'0')" class='btn'> <input type="button" name="dot" value="." style="height:32px" onclick="addchar(this.form.txt,'.')" class='btn'><input type="button" name="equal" value="=" style="height:32px" onclick="equal_click()" class='btn'><input type="button" name="div" value="/" style="height:32px" onclick="addchar(this.form.txt,'/')" class='btn'><input type="button" name="sign" value="+/-" style="height:32px" onclick="sign_click()" class='btn'><input type="button" name="resi" value="1/x" style="height:32px" onclick="resi_click()" class='btn'> </td></tr> </table> </center> </form> </body>
Get free version without ©copyright link for just $10/ -
For customization of this script or any script development, mail to support@hscripts.com
Usage
This is free scientific calculator. By using this you can perform mathematical operations. Just copy the above code and use it in your web page. Make sure that you can use the calc-func() page properly.
License
Related Scripts