Skip to content

Documentation / @interstellar-tools/maps / curvatureGrid

Function: curvatureGrid() ​

ts
function curvatureGrid(grid: GridInterface): {
  planform: GridInterface;
  profile: GridInterface;
};

Defined in: terrain/curvature.ts:148

Compute the profile and planform curvature of every cell of an elevation grid, as two new grids in 1/m.

See curvatureAt. Cells on the edge and next to a missing cell are NaN.

Parameters ​

ParameterTypeDescription
gridGridInterfaceElevation grid, heights in m.

Returns ​

ts
{
  planform: GridInterface;
  profile: GridInterface;
}

Two grids of the same shape, { profile, planform }, curvature in 1/m.

NameTypeDefined in
planformGridInterfaceterrain/curvature.ts:150
profileGridInterfaceterrain/curvature.ts:150

Throws ​

  • If a size or cell size is not finite.
  • If the grid's parts don't fit together.

Example ​

ts
const { profile, planform } = curvatureGrid(grid);
gridValueAt(planform, 1, 1); // ≈ 0.00995

See ​

curvatureAt