keisoku

Polygon Area from Coordinates (Shoelace Formula)

Enter vertex coordinates in order to compute a polygon area with the shoelace formula. Also returns vertex count, perimeter, and centroid, handles concave shapes, and draws a coordinate diagram.

Input

Enter the vertex coordinates one point per line, in order around the polygon. The area is computed with the shoelace formula, along with the perimeter and centroid.

Enter x and y separated by a comma on each line. At least 3 vertices are required.

Result

CentroidArea 16

Area

16

Vertices

5

Perimeter

15.656854

Centroid

(2, 2.041667)


The area is computed with the shoelace formula (Gauss area formula). It assumes a simple polygon without self intersections and supports concave shapes.

How it works

  • The area is computed with the shoelace formula (Gauss area formula). The signed area A sums x_i times y_next minus x_next times y_i over every edge, then divides by 2.
  • The displayed area is the absolute value of this signed area. Listing vertices counter clockwise gives a positive sign and clockwise gives a negative sign, but the area value does not depend on direction.
  • The perimeter sums the distance between consecutive vertices across all edges, including the closing edge from the last vertex back to the first, treating the polygon as closed.
  • The centroid is found with an area weighted formula. For a degenerate shape whose area is near zero, the plain average of the vertex coordinates is used instead.
  • A simple polygon without self intersections is assumed. Concave shapes are supported, but figures whose edges cross each other may not give a correct area.
  • Each line holds x and y separated by a comma. Blank lines are ignored, and at least 3 vertices are required.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Polygon Area from Coordinates (Shoelace Formula)