Area of a Polygon Calculator

.polygon-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e4e8; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); } .polygon-calc-header { text-align: center; margin-bottom: 30px; } .polygon-calc-header h2 { color: #2c3e50; margin-bottom: 10px; } .polygon-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; } .polygon-calc-group { display: flex; flex-direction: column; } .polygon-calc-group label { font-weight: 600; margin-bottom: 8px; color: #34495e; } .polygon-calc-group input { padding: 12px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 16px; } .polygon-calc-btn { background-color: #3498db; color: white; border: none; padding: 15px 30px; font-size: 18px; font-weight: bold; border-radius: 6px; cursor: pointer; width: 100%; transition: background-color 0.2s; } .polygon-calc-btn:hover { background-color: #2980b9; } .polygon-calc-result { margin-top: 30px; padding: 20px; background-color: #f8fafc; border-radius: 8px; border-left: 5px solid #3498db; display: none; } .polygon-calc-result h3 { margin-top: 0; color: #2c3e50; } .result-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf2f7; } .result-value { font-weight: bold; color: #2c3e50; } .polygon-article { margin-top: 40px; line-height: 1.6; color: #4a5568; } .polygon-article h2 { color: #2d3748; border-bottom: 2px solid #edf2f7; padding-bottom: 10px; margin-top: 30px; } @media (max-width: 600px) { .polygon-calc-grid { grid-template-columns: 1fr; } }

Regular Polygon Area Calculator

Calculate the area, perimeter, and angles of any regular polygon by entering the number of sides and the side length.

Calculation Results

Polygon Type:
Total Area:
Perimeter:
Interior Angle:
Sum of Interior Angles:
Apothem (Inradius):

Understanding Regular Polygon Geometry

A regular polygon is a two-dimensional geometric shape where all sides have the same length and all interior angles are equal. Examples include equilateral triangles, squares, regular pentagons, and hexagons. Calculating the area of these shapes is a fundamental task in geometry, architecture, and engineering.

The Regular Polygon Area Formula

To find the area of a regular polygon with n sides and side length s, we use the following mathematical formula:

Area = (n × s²) / (4 × tan(π / n))

Where:

  • n is the number of sides.
  • s is the length of a single side.
  • tan is the tangent function.
  • π (Pi) is approximately 3.14159.

Key Components of a Polygon

Beyond the area, several other metrics define a polygon's properties:

  • Perimeter: The total length of the boundary, calculated as n × s.
  • Interior Angle: The angle between two adjacent sides, calculated as ((n – 2) × 180°) / n.
  • Apothem: The distance from the center of the polygon to the midpoint of any side. It acts as the "inradius" of the shape.
  • Sum of Interior Angles: The total degrees of all interior angles combined, which is (n – 2) × 180°.

Step-by-Step Calculation Example

Let's calculate the area of a Regular Hexagon (6 sides) with a side length of 8 units.

  1. Identify the variables: n = 6, s = 8.
  2. Calculate the perimeter: 6 × 8 = 48 units.
  3. Calculate the interior angle: ((6 – 2) × 180) / 6 = 120°.
  4. Apply the area formula:
    Area = (6 × 8²) / (4 × tan(180/6))
    Area = (6 × 64) / (4 × tan(30°))
    Area = 384 / (4 × 0.577)
    Area ≈ 166.28 square units.

Common Polygon Names

Sides Name
3Equilateral Triangle
4Square
5Regular Pentagon
6Regular Hexagon
8Regular Octagon
10Regular Decagon
function calculatePolygonArea() { var n = parseFloat(document.getElementById('polySides').value); var s = parseFloat(document.getElementById('sideLength').value); var resultDiv = document.getElementById('polygonResult'); if (isNaN(n) || isNaN(s) || n < 3 || s <= 0) { alert("Please enter a valid number of sides (minimum 3) and a positive side length."); resultDiv.style.display = "none"; return; } // Polygon Type Names var typeName = "Polygon"; var types = { 3: "Equilateral Triangle", 4: "Square", 5: "Regular Pentagon", 6: "Regular Hexagon", 7: "Regular Heptagon", 8: "Regular Octagon", 9: "Regular Nonagon", 10: "Regular Decagon", 12: "Regular Dodecahedron" }; if (types[n]) { typeName = types[n]; } else { typeName = n + "-sided Regular Polygon"; } // Calculations // Area = (n * s^2) / (4 * tan(PI/n)) var area = (n * Math.pow(s, 2)) / (4 * Math.tan(Math.PI / n)); var perimeter = n * s; var sumAngle = (n – 2) * 180; var intAngle = sumAngle / n; var apothem = s / (2 * Math.tan(Math.PI / n)); // Display results document.getElementById('resType').innerHTML = typeName; document.getElementById('resArea').innerHTML = area.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 4}); document.getElementById('resPerimeter').innerHTML = perimeter.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); document.getElementById('resIntAngle').innerHTML = intAngle.toFixed(2) + "°"; document.getElementById('resSumAngle').innerHTML = sumAngle.toFixed(0) + "°"; document.getElementById('resApothem').innerHTML = apothem.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 4}); resultDiv.style.display = "block"; }

Leave a Comment