Documentation / @interstellar-tools/maps / aspectGrid
Function: aspectGrid()
ts
function aspectGrid(grid: GridInterface): GridInterface;Defined in: terrain/aspect.ts:85
Compute the aspect of every cell of an elevation grid, as a new grid in radians clockwise from north.
See aspectAt. Flat cells, cells on the edge and cells next to a missing cell are NaN.
Parameters
| Parameter | Type | Description |
|---|---|---|
grid | GridInterface | Elevation grid, heights in m. |
Returns
A grid of the same shape, aspects in radians.
Throws
- If a size or cell size is not finite.
- If the grid's parts don't fit together.
Example
ts
const aspects = aspectGrid(grid);
gridValueAt(aspects, 1, 1); // 3π/2