perimetre as grid[] polygon as grid[N, 2] or any cyclic path as grid[N, M] finds the perimetre of a sequence of points in which the last point is assumed to connect back to the first point. this not need be an actual polygon (because points don't need to be coplanar for this calculation to work).