Script Categories

Calculators >>> Polygon.

Figure out the number of sides, measure of each exterior angle, and the measure of the interior angle of any polygon. Simply enter one of the three pieces of information!

The sum of the measures of the angles of a convex polygon with n sides is (n - 2)180.

Sides on the polygon:
Measure of each exterior angle:
Measure of each interior angle:

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function side(form) {
var n = document.form1.n.value;
document.form1.n.value = n;
document.form1.intx.value = ((n - 2) * 180) / n;
document.form1.ext.value = 180 - document.form1.intx.value;
function extn(form) {
var e = document.form1.ext.value;
document.form1.n.value = 360 / e;
document.form1.intx.value = 180 - e;
function intn(form) {
var i = document.form1.intx.value;
document.form1.ext.value = 180 - i;
document.form1.n.value = 360 / (180 - i);
//  End -->
The sum of the measures of the angles of a convex polygon with <i>n</i> sides is <b>(<i>n</i> - 2)180.</b><br>
<form name="form1">
<table width="500" border="1">
Sides on the polygon:</td>
<input name="n"></td>
<input type="button" value=" Find " onClick="side(this.form)"></td></tr>
Measure of each exterior angle:</td>
<input name="ext"></td>
<input type="button" value=" Find " onClick="extn(this.form)"></td></tr>
Measure of each interior angle:</td>
<input name="intx"></td>
<input type="button" value=" Find " onClick="intn(this.form)"></td></tr>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.

Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).