GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72846
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gradient.c File Reference

Gradient computation. More...

#include <grass/raster3d.h>
Include dependency graph for gradient.c:

Go to the source code of this file.


void Rast3d_gradient_double (RASTER3D_Array_double *array, double *step, RASTER3D_Array_double *grad_x, RASTER3D_Array_double *grad_y, RASTER3D_Array_double *grad_z)
 Gradient computation. More...

Detailed Description

Gradient computation.

(C) 2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Anna Petrasova

Definition in file gradient.c.

Function Documentation

void Rast3d_gradient_double ( RASTER3D_Array_double array,
double *  step,
RASTER3D_Array_double grad_x,
RASTER3D_Array_double grad_y,
RASTER3D_Array_double grad_z 

Gradient computation.

Gradient computation (second order approximation) using central differencing scheme (plus forward and backward difference of second order approximation). When one or more of the cells, from which the gradient for a particular cell is computed, is null, gradient for that particular cell is set to 0.

arraypointer to RASTER3D_Array with input values
steparray of x, y, z steps for gradient (resolution values)
[out]grad_xpointer to RASTER3D_Array_double with gradient in x direction
[out]grad_ypointer to RASTER3D_Array_double with gradient in y direction
[out]grad_zpointer to RASTER3D_Array_double with gradient in z direction

Definition at line 34 of file gradient.c.

References DCELL_TYPE, Rast_is_d_null_value(), Rast_set_null_value(), RASTER3D_ARRAY_ACCESS, RASTER3D_Array_double::sx, RASTER3D_Array_double::sy, RASTER3D_Array_double::sz, val1, and val2.