Tip: You can modify some of the code before running
<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> knows two points of the coordinates of the computer out of their distance </title> </pead> <body> <script language=" JavaScript > <!--Begin function distance (form) {var x1 = eval (form.x1.value); var y1 = eval (form.y1.value); var x2 = eval (form.x2.value); var y2 = eval (form.y2.value); var xdiff = x2-x1; var ydiff = y2-y1; Form.answer.value = Math.pow (Xdiff * xdiff + Ydiff * ydiff), 0.5); }//End--> </script> <center> <form> <table border=3 cellspacing=2 cellpadding=5> <tr> <TD colspan=4 align=center> compute the distance between plane two points </td> </tr> <tr> <td colspan=2 align=center>a Point </td> <td colspan=2 align=center>b point </td> </tr> <tr> <td align=center>a Point Horizontal axis </td > <td align=center>a Point ordinate </td> <td align=center>b Point horizontal axis </td> <td align=center>b Point ordinate </td> </tr> <tr> <td align=Center><input type=text name=x1 size=5></td> <td align=center><input type=text name=y1 size=5 ></td> <td align=center><input type=text name=x2 size=5></td> <td align=center>< Input Type=text name=y2 size=5></td> </tr> <tr> <td colspan=4 align=center><input type= Button value= "Calculate Distance" onclick= "distance (this.form)" ></td> </tr> <tr> <td colspan=4 align=center ><input type=text name=answer size=20></td> </tr> </table> </form> </center> </body> </ptml>
Tip: You can modify some of the code before running