How this calculation works
A parallel-edge offset moves each supporting line by the same perpendicular distance while retaining the polygon interior side. Positive distance expands the polygon; negative distance creates an inset. This page constructs the intersection of all shifted half-planes, retaining feasible line intersections and removing edges that become redundant. It uses miter corners rather than circular arcs and explicitly detects when an inset no longer encloses a positive-area region.
For normalized outward edge normals n_i, replace n_i·x≤b_i by n_i·x≤b_i+d and intersect the half-planes.A worked example
A square with corners (0,0), (4,0), (4,4), (0,4) expanded outward by one becomes the square from (−1,−1) to (5,5). Its area is 36 and perimeter 24. An inset distance of one gives the square from (1,1) to (3,3), with area four and perimeter eight. Insetting by two collapses to the center point; larger insets do not create a reversed square.
Good to know
Supports strictly convex boundaries with 3–30 vertices, no redundant collinear edge points and finite coordinates within ±10⁹. The signed offset is in the same length unit. This is a supporting-line miter offset, not a round-corner buffer or a nonconvex straight-skeleton implementation. Acute corners can produce long miters. Very small surviving regions and near-parallel edge intersections have numerical tolerance limits.
Reference: CGAL — polygon offset supporting lines and straight-skeleton context (opens in a new tab) ↗
Equal edge displacement does not mean equal vertex displacement
The offset distance is measured perpendicular to each edge line. A corner is reconstructed where two surviving shifted lines meet, so its movement is usually larger than the selected perpendicular distance. At an acute corner, the miter can extend a long way. Scaling a polygon about its centroid instead moves vertices radially and generally does not keep every edge at the same perpendicular distance from its original position.
For an inward offset, some original constraints can become redundant before complete collapse. Simply intersecting consecutive original edges and retaining every resulting vertex can therefore produce a misleading boundary. This implementation considers feasible supporting-line intersections against all shifted interior half-planes. A valid output is the surviving convex intersection, whose number of vertices need not always match the input.
The Convex polygon intersection area calculator from coordinates combines two input shapes. This offset page constructs a new boundary from one shape and an edge displacement.
A rounded buffer and a miter offset have different corner areas
A Euclidean outward buffer of a convex polygon normally adds rounded arcs at the corners. The miter construction here extends straight shifted edges until they meet. For the four-by-four square expanded by one, the miter area is 36, whereas a round buffer would have area 16+16+π. These are different geometric operations, so comparing them without naming the join convention can make a correct result appear wrong.
An inset can shrink to a line, point or empty region. Reporting a new positive area after crossing that collapse would effectively invert constraints rather than describe the intended interior. This page returns a collapse status and zero polygon measurements for that condition. Numerical geometry also has a resolution threshold, so a tiny region may be labeled negligible before ideal mathematical collapse. Measurement uncertainty and computational tolerance should both be considered near that limit.
A few questions, answered
Does positive offset always mean outward?
Yes. The polygon winding is normalized internally, so the sign convention does not reverse when you reverse the input boundary.
Can this calculate a nonconvex roof or floor-plan inset?
No. Nonconvex offsets can split into components and need a more general construction. This page deliberately accepts convex boundaries only.