{
  "id": "irregular-shape-area",
  "version": "c68579f48ebb",
  "status": "published",
  "name": "Irregular Shape Area Calculator",
  "question": "What is the irregular shape area?",
  "summary": "Finds the area of an irregular shape from its corner coordinates by the shoelace formula, or from triangles of three measured sides by Heron’s formula, with the perimeter, square metres, square feet and hectares.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/irregular-shape-area-calculator",
  "markdown": "https://www.acalculator.org/math/irregular-shape-area-calculator.md",
  "kind": "function",
  "method": "Corners: A = ½ |Σ (xᵢ × yᵢ₊₁ − xᵢ₊₁ × yᵢ)| (the shoelace formula), going around the corners and back to the first. Triangles: each area is √(s(s − a)(s − b)(s − c)) with s = (a + b + c) ÷ 2 (Heron’s formula), and the areas add up.",
  "assumptions": [
    "The corners are listed in order around the shape, and its edges do not cross.",
    "Triangles do not overlap and together cover the shape.",
    "Typed numbers are read as exact decimals; a root that is not exact is rounded once."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "by": {
        "title": "I know",
        "description": "The corners as x and y coordinates, or the shape split into triangles with three measured sides each.",
        "type": "string",
        "enum": [
          "corners",
          "triangles"
        ]
      },
      "p": {
        "title": "Corners (x, y), in order around the shape",
        "description": "One corner per row, x then y, going around the shape in order: 3 to 30 corners.",
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "t": {
        "title": "Triangles",
        "description": "Split the shape into triangles that do not overlap, and type the three sides of each.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "a": {
              "title": "Side a",
              "description": "The first side of the triangle.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1000000000
            },
            "b": {
              "title": "Side b",
              "description": "The second side of the triangle.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1000000000
            },
            "c": {
              "title": "Side c",
              "description": "The third side of the triangle.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1000000000
            }
          }
        }
      },
      "u": {
        "title": "Length unit",
        "description": "The unit of the coordinates or sides; with a unit, the area is also shown in m², ft² and hectares.",
        "type": "string",
        "enum": [
          "units",
          "cm",
          "m",
          "km",
          "in",
          "ft",
          "yd",
          "mi"
        ]
      }
    }
  },
  "outputs": {
    "result": {
      "label": "Area",
      "description": "The area in the chosen unit squared.",
      "format": "text"
    },
    "area": {
      "label": "Area (unit²)",
      "description": "The area in the typed unit squared.",
      "format": "number"
    },
    "perimeter": {
      "label": "Perimeter (unit)",
      "description": "The distance around the shape: the sum of the edge lengths.",
      "format": "number"
    },
    "m2": {
      "label": "Area, m²",
      "description": "The area in square metres.",
      "format": "number"
    },
    "ft2": {
      "label": "Area, ft²",
      "description": "The area in square feet: m² ÷ 0.09290304.",
      "format": "number"
    },
    "hectares": {
      "label": "Area, hectares",
      "description": "The area in hectares: m² ÷ 10,000.",
      "format": "number"
    },
    "steps": {
      "label": "Steps",
      "description": "The area worked out, step by step.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "by": "corners",
      "p": [
        [
          0,
          0
        ],
        [
          4,
          0
        ],
        [
          5,
          3
        ],
        [
          2,
          5
        ],
        [
          0,
          3
        ]
      ],
      "t": [
        {
          "a": 30,
          "b": 40,
          "c": 50
        },
        {
          "a": 35,
          "b": 25,
          "c": 50
        }
      ],
      "u": "m"
    },
    "outputs": {
      "result": "18.5 m²",
      "area": 18.5,
      "perimeter": 16.596256060378558,
      "m2": 18.5,
      "ft2": 199.13234270912986,
      "hectares": 0.00185,
      "steps": "1 to 2: 0 × 0 − 4 × 0 = 0; 2 to 3: 4 × 3 − 5 × 0 = 12; 3 to 4: 5 × 5 − 2 × 3 = 19; 4 to 5: 2 × 3 − 0 × 5 = 6; 5 to 1: 0 × 0 − 0 × 3 = 0; Sum = 37; Area = |37| ÷ 2 = 18.5"
    },
    "text": "The area is 18.5 m²."
  },
  "examples": [
    {
      "given": {
        "by": "corners",
        "p": [
          [
            0,
            0
          ],
          [
            4,
            0
          ],
          [
            5,
            3
          ],
          [
            2,
            5
          ],
          [
            0,
            3
          ]
        ],
        "u": "m"
      },
      "expect": {
        "area": 18.5,
        "result": "18.5 m²",
        "steps": "1 to 2: 0 × 0 − 4 × 0 = 0; 2 to 3: 4 × 3 − 5 × 0 = 12; 3 to 4: 5 × 5 − 2 × 3 = 19; 4 to 5: 2 × 3 − 0 × 5 = 6; 5 to 1: 0 × 0 − 0 × 3 = 0; Sum = 37; Area = |37| ÷ 2 = 18.5",
        "perimeter": 16.596256060378558
      },
      "source": "OpenStax, Calculus Volume 3, §2.4 The Cross Product (Theorem 2.8: ‖u × v‖ is the area of the parallelogram with sides u and v; Example 2.39: a triangle’s area is half of it), https://openstax.org/books/calculus-volume-3/pages/2-4-the-cross-product (retrieved 2026-10-19); hand calculation in content.mdx (shoelace formula)"
    },
    {
      "given": {
        "by": "corners",
        "p": [
          [
            0,
            0
          ],
          [
            0,
            3
          ],
          [
            4,
            0
          ]
        ],
        "u": "ft"
      },
      "expect": {
        "area": 6,
        "perimeter": 12,
        "ft2": 6,
        "m2": 0.55741824
      },
      "source": "OpenStax, Calculus Volume 3, §2.4 The Cross Product (Theorem 2.8: ‖u × v‖ is the area of the parallelogram with sides u and v; Example 2.39: a triangle’s area is half of it), https://openstax.org/books/calculus-volume-3/pages/2-4-the-cross-product (retrieved 2026-10-19); NIST Special Publication 811, Appendix B.8 (1 in = 0.0254 m, 1 ft = 0.3048 m, 1 ft² = 0.09290304 m², 1 yd = 0.9144 m, 1 mi = 1,609.344 m, 1 ha = 10,000 m²), https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b8 (retrieved 2026-10-19); hand calculation in content.mdx: ½ × 3 × 4 = 6 ft² = 6 × 0.09290304 m²"
    },
    {
      "given": {
        "by": "triangles",
        "t": [
          {
            "a": 10,
            "b": 15,
            "c": 7
          }
        ],
        "u": "units"
      },
      "expect": {
        "area": 29.393876913398138,
        "result": "29.39387691 square units"
      },
      "source": "OpenStax, Precalculus 2e, §8.2 Non-right Triangles: Law of Cosines (Heron’s formula, Area = √(s(s − a)(s − b)(s − c)) with s = (a + b + c) ÷ 2; Example 5: sides 10, 15 and 7 give about 29.4; Example 6: a lot with sides 62.4 m, 43.5 m and 34.1 m has about 711.4 m²), https://openstax.org/books/precalculus-2e/pages/8-2-non-right-triangles-law-of-cosines (retrieved 2026-10-19); hand calculation in content.mdx: s = 16, √(16 × 6 × 1 × 9) = √864"
    },
    {
      "given": {
        "by": "triangles",
        "t": [
          {
            "a": 62.4,
            "b": 43.5,
            "c": 34.1
          }
        ],
        "u": "m"
      },
      "expect": {
        "area": 711.4198479097979,
        "hectares": 0.07114198479097979
      },
      "source": "OpenStax, Precalculus 2e, §8.2 Non-right Triangles: Law of Cosines (Heron’s formula, Area = √(s(s − a)(s − b)(s − c)) with s = (a + b + c) ÷ 2; Example 5: sides 10, 15 and 7 give about 29.4; Example 6: a lot with sides 62.4 m, 43.5 m and 34.1 m has about 711.4 m²), https://openstax.org/books/precalculus-2e/pages/8-2-non-right-triangles-law-of-cosines (retrieved 2026-10-19); hand calculation in content.mdx: s = 70, √(70 × 7.6 × 26.5 × 35.9)"
    },
    {
      "given": {
        "by": "triangles",
        "t": [
          {
            "a": 30,
            "b": 40,
            "c": 50
          },
          {
            "a": 35,
            "b": 25,
            "c": 50
          }
        ],
        "u": "m"
      },
      "expect": {
        "area": 1006.201920231798
      },
      "source": "OpenStax, Precalculus 2e, §8.2 Non-right Triangles: Law of Cosines (Heron’s formula, Area = √(s(s − a)(s − b)(s − c)) with s = (a + b + c) ÷ 2; Example 5: sides 10, 15 and 7 give about 29.4; Example 6: a lot with sides 62.4 m, 43.5 m and 34.1 m has about 711.4 m²), https://openstax.org/books/precalculus-2e/pages/8-2-non-right-triangles-law-of-cosines (retrieved 2026-10-19); hand calculation in content.mdx: 600 + √165,000 = 1,006.2 m²"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 3, §2.4 The Cross Product: Theorem 2.8 (‖u × v‖ is the area of the parallelogram with adjacent sides u and v) and Example 2.39 (the triangle PQR has half that area), retrieved 2026-10-19. https://openstax.org/books/calculus-volume-3/pages/2-4-the-cross-product",
    "OpenStax, Precalculus 2e, §8.2 Non-right Triangles: Law of Cosines: Heron’s formula, Area = √(s(s − a)(s − b)(s − c)) with s the semi-perimeter; Example 5 (sides 10, 15 and 7: about 29.4 square units) and Example 6 (a lot with sides 62.4 m, 43.5 m and 34.1 m: about 711.4 m²), retrieved 2026-10-19. https://openstax.org/books/precalculus-2e/pages/8-2-non-right-triangles-law-of-cosines",
    "NIST Special Publication 811, Appendix B.8: 1 in = 0.0254 m, 1 ft = 0.3048 m, 1 ft² = 0.09290304 m², 1 yd = 0.9144 m, 1 mi = 1,609.344 m, 1 ha = 10,000 m², all exact, retrieved 2026-10-19. https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b8"
  ],
  "related": [
    "area",
    "triangle-area",
    "perimeter",
    "trapezoid"
  ],
  "changelog": []
}
