rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script language="javascript">
document.open();
ver=7;//
masver=new Array(ver);
for (i=0;i<ver;i++) {
masver[i]=new Array(2);
}
//
masver[0][0]=2; //x
masver[0][1]=2; //y
masver[1][0]=4;
masver[1][1]=1;
masver[2][0]=6;
masver[2][1]=2;
masver[3][0]=6;
masver[3][1]=4;
masver[4][0]=4;
masver[4][1]=5;
masver[5][0]=2;
masver[5][1]=5;
masver[6][0]=1;
masver[6][1]=4;
//
document.write("<br>:<br><table><tr align=center><td></td><td>X</td><td>Y</td></tr>");
for (i=0;i<ver;i++) {
document.write("<tr align='center'><td>",i+1,"</td>");
for (j=0;j<2;j++)
{document.write("<td>",masver[i][j],"</td>");}
document.write("</tr>");}
document.write("</table>");
function ploshad(x1,y1,x2,y2,x3,y3) {
a=Math.sqrt(Math.pow(x2-x1,2)+Math.pow(y2-y1,2));
b=Math.sqrt(Math.pow(x3-x2,2)+Math.pow(y3-y2,2));
c=Math.sqrt(Math.pow(x1-x3,2)+Math.pow(y1-y3,2));
p=((a+b+c)/2);
tre=Math.sqrt(p*(p-a)*(p-b)*(p-c));
return tre;
}
var s=ploshad(masver[0][0],masver[0][1],masver[1][0],masver[1][1],masver[2][0],masver[2][1]);
document.write(ploshad(masver[0][0],masver[0][1],masver[1][0],masver[1][1],masver[2][0],masver[2][1]));
for (i=2;i<ver;i++) {
var s=s+ploshad(masver[0][0],masver[0][1],masver[i][0],masver[i][1],masver[i+1][0],masver[i+1][1]);
}
document.write(" : ",s);
document.close();
</script>
</body>
</html>