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
| Parameter | Type | Description |
|---|---|---|
grid | GridInterface | Elevation grid, heights in m. |
Returns
ts
{
planform: GridInterface;
profile: GridInterface;
}Two grids of the same shape, { profile, planform }, curvature in 1/m.
| Name | Type | Defined in |
|---|---|---|
planform | GridInterface | terrain/curvature.ts:150 |
profile | GridInterface | terrain/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