kml_?_spline2d_set
Set zarr to z at grid point (i, j).
Interface Definition
int kml_float_spline2d_set(const kml_float_spline2d *spline, float zarr[], const size_t i, const size_t j, const float z)
int kml_double_spline2d_set(const kml_double_spline2d *spline, double zarr[], const size_t i, const size_t j,
const double z);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
spline |
kml_float_spline2d*, kml_double_spline2d* |
Pointer to an interpolation object. |
Input |
zarr |
float, double |
Array that stores the value of z. |
Output |
i |
size_t |
Index in the x direction. |
Input |
j |
size_t |
Index in the y direction. |
Input |
z |
float |
Value of z to be changed. |
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));
float x = 1;
float y = 1;
float z = 0;
kml_float_spline2d *spline = kml_float_spline2d_alloc(kml_float_interp2d_bicubic, xSize, ySize);
kml_float_spline2d_init(spline, xArr, yArr, zArr, xSize, ySize);
kml_float_spline2d_eval(spline, xArr, yArr, zArr, x, y, xacc, yacc, &z);
kml_float_spline2d_set(spline, zArr, x, y, z);
Parent topic: spline2d