topical media & game development

talk show tell print

lib-js-math-calculator-cosine.htm / htm



  
  <!-- TWO STEPS TO INSTALL COSINE CALCULATOR:
  
    1.  Copy the coding into the HEAD of your HTML document
    2.  Add the last code into the BODY of your HTML document  -->
  
  <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  
  <SCRIPT LANGUAGE="JavaScript">
  
  <!-- This script and many more are available online free at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  
  <!-- Begin
  function calccos(form) {
  var adj = eval(form.adj.value);
  var hyp = eval(form.hyp.value);
  form.cos.value = adj/hyp;
  }
  // End -->
  </script>
  
  <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  
  <center>
  <form>
  <table border=3 cellspacing=2 cellpadding=5>
  <tr>
  <td align=center><i>Adjacent Angle</i></td>
  <td align=center><i>Hypotenuse Angle</i></td>
  <td align=center><i>Cosine Angle</i></td>
  </tr>
  <tr>
  <td align=center><input type=text name=adj size=15></td>
  <td align=center><input type=text name=hyp size=15></td>
  <td align=center><input type=text name=cos size=15></td>
  </tr>
  <tr>
  <td colspan=3 align=center><input type=button value="Calculate!" onclick="calccos(this.form)"></td>
  </tr>
  </table>
  </form>
  </center>
  
  <p><center>
  <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
  by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  </center><p>
  
  <!-- Script Size:  1.19 KB -->
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.