kml_?_spline2d_get
Return value zij of array zarr at grid point (i, j).
Interface Definition
float kml_float_spline2d_get(const kml_float_spline2d *spline, const float zarr[], const size_t i, const size_t j)
double kml_double_spline2d_get(const kml_double_spline2d *spline, const double zarr[], const size_t i, const size_t j);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
spline |
const kml_float_spline2d* / const kml_double_spline2d* |
Pointer to an interpolation object. |
Input |
zarr |
Float/Double array |
Array that stores the value of z. |
Input |
i |
size_t |
Index in the x direction. |
Input |
j |
size_t |
Index in the y direction. |
Input |
Dependencies
#include "kipl.h"
Examples
const size_t xSize = 4;
const size_t ySize = 4;
float xArr[4] = {1,1.33,1.67,2};
float yArr[4] = {1,1.33,1.67,2};
float* zArr = (float*)malloc(xSize * ySize * sizeof(float));
size_t x = 1;
size_t y = 1;
kml_float_spline2d *spline = kml_float_spline2d_alloc(kml_float_interp2d_bicubic, xSize, ySize);
kml_float_spline2d_init(spline, xArr, yArr, zArr, xSize, ySize);
z = kml_float_spline2d_get(spline, zArr, x, y);
Parent topic: spline2d