FemtoScan Online SDK Documentation

Home :: FsOnlineSDK :: fmutl classes

function eval_spline_factors

^ 
Evaluate cubic spline coefficients.

Spline coefficients evaluated by fitting equation y=a+b*x+c*x*x+d*x*x*x to reference points. Restriction put on first derivation continuity. First and last equations has 2-nd order (d=0).

Source:
../fmutl/mathlp.h:67
Author:
ATC
Version:
1.0
Params:
in reference points in form
 x0,y0,x1,y1,...x<in_sz-1>,y<in_sz-1>
Totally sizeof(double)*2*in_sz bytes.
abcd result of evaluation in form
 a0,b0,c0,d0,a1,b1,...a<in_sz-2>,...d<in_sz-2>
a0..d0 coefficiens are valid on segment (-inf,x1], a1..d1 are valid on [x1-x2], etc., and a<in_sz-2>..d<in_sz-2> are valid on [x<in_sz-2>,+inf) segment. Totally sizeof(double)*4*(in_sz-1) bytes should be allocated for storing coefficients. In final evaluation not original x-coordinates, but their offsets from reference x-points should be used. This is made by design, which reduces error for large numbers. Point in position x on segment x<i>..x<i+1> can be found by equation
 dx=x-in[i*2];
 y=abcd[i*4]+abcd[i*4+1]*dx+abcd[i*4+2]*dx*dx+abcd[i*4+3]*dx*dx*dx;
Code:
public extern "C" FMUTL_API bool eval_spline_factors ( double * in ,
double * abcd ,
int in_sz )

(C) Advanced Technologies Center, 2002-2006
For support contact us at fsdev@nanoscopy.net