### 28.10 2D Interpolation Functions

The interpolation function for a given dataset is stored in a `gsl_interp2d` object. These are created by the following functions.

Function: gsl_interp2d * gsl_interp2d_alloc (const gsl_interp2d_type * T, const size_t xsize, const size_t ysize)

  This function returns a pointer to a newly allocated interpolation object of type T for xsize grid points in the x direction and ysize grid points in the y direction.

Function: int gsl_interp2d_init (gsl_interp2d * interp, const double xa[], const double ya[], const double za[], const size_t xsize, const size_t ysize)

  This function initializes the interpolation object interp for the data (xa,ya,za) where xa and ya are arrays of the x and y grid points of size xsize and ysize respectively, and za is an array of function values of size xsize*ysize. The interpolation object (`gsl_interp2d`) does not save the data arrays xa, ya, and za and only stores the static state computed from the data. The xa and ya data arrays are always assumed to be strictly ordered, with increasing x,y values; the behavior for other arrangements is not defined.

Function: void gsl_interp2d_free (gsl_interp2d * interp)

  This function frees the interpolation object interp.