Hi,
You can use ocmath_convert_regular_xyz_to_matrix as an replacement
Sample Code are as following
#include <wks2mat.h>
void ocmath_convert_regular_xyz_to_matrix_ex1()
{
double dPrecision = 1.0e-8;
UINT n = 9;
double a[]={1,1,1,2,2,2,3,3,3};
double b[]={1,2,3,1,2,3,1,2,3};
double c[]={5,3,7,3,6,5,0,4,3};
double mat[100];
double Xmin, Ymin, Xstep, Ystep, Xmax, Ymax;
int nRet = ocmath_xyz_examine_data(n, a, b, c, dPrecision, &n, &Xmin,
&Xstep, &Xmax, &Ymin, &Ystep, &Ymax, true);
if(nRet == 0)
{
printf("X: %g\t%g\t%g\n ", Xmin, Xstep, Xmax);
printf("Y: %g\t%g\t%g\n ", Ymin, Ystep, Ymax);
int iX, iY;
iX = Xstep > 0 ? (int)((Xmax - Xmin) / Xstep + 0.5) + 1 : 1;
iY = Ystep > 0 ? (int)((Ymax - Ymin) / Ystep + 0.5) + 1 : 1;
nRet = ocmath_convert_regular_xyz_to_matrix(n, a, b, c,
mat, Xmin, Xstep, iX, Ymin, Ystep, iY);
for(int i=0; i<iY; i++)
{
for(int j=0; j<iX; j++)
printf("%g\t",mat[i*iX + j]);
printf("\n");
}
}
}