94 for(
int i=0; i<nValues; i++)
96 Add(xValues[i], yValues[i]);
137 double p, qn, sig, un;
146 m_x[i] = x[Index[i]];
147 m_y[i] = y[Index[i]];
167 sig = (
m_x[i] -
m_x[i - 1]) / (
m_x[i + 1] -
m_x[i - 1]);
168 p = sig *
m_z[i - 1] + 2.;
169 m_z[i] = (sig - 1.) / p;
172 u [i] = (6. * u[i] / (
m_x[i + 1] -
m_x[i - 1]) - sig * u[i - 1]) / p;
182 un = (3. / (
m_x[n - 1] -
m_x[n - 2]))
183 * (yB - (
m_y[n - 1] -
m_y[n - 2])
184 / (
m_x[n - 1] -
m_x[n - 2]));
187 m_z[n - 1] = (un - qn * u[n - 2]) / (qn *
m_z[n - 2] + 1.);
189 for(k=n-2; k>=0; k--)
216 while( khi - klo > 1 )
234 a = (
m_x[khi] - x) / h;
235 b = (x -
m_x[klo]) / h;
237 y = a *
m_y[klo] + b *
m_y[khi]
238 + ((a*a*a - a) *
m_z[klo] + (b*b*b - b) *
m_z[khi]) * (h*h) / 6.;
325 return( sqrt(
A.x*
A.x +
A.y*
A.y) );
329 double CSG_Thin_Plate_Spline::_Get_Base_Funtion(
double x)
331 return( x > 0. ? x*x * log(x) : 0. );
335 double CSG_Thin_Plate_Spline::_Get_Base_Funtion(
TSG_Point_3D A,
double x,
double y)
340 double d = sqrt(x*x + y*y);
342 return( d > 0. ? d*d * log(d) : 0. );
386 for(
sLong j=i+1; j<n; ++j)
388 double b = _Get_hDistance(Point, m_Points[j]); a += b * 2.;
390 M[i][j] = (M[j][i] = _Get_Base_Funtion(b));
399 for(
sLong i=0; i<n; ++i)
402 M[i][i] = Regularization * (a*a);
405 M[i][n + 0] = M[n + 0][i] = 1.;
406 M[i][n + 1] = M[n + 1][i] = m_Points[i].x;
407 M[i][n + 2] = M[n + 2][i] = m_Points[i].y;
410 m_V[i] = m_Points[i].z;
413 for(
sLong i=n; i<n+3; ++i)
415 for(
sLong j=n; j<n+3; ++j)
421 m_V[n + 0] = m_V[n + 1] = m_V[n + 2] = 0.;
447 double z = m_V[n + 0] + m_V[n + 1] * x + m_V[n + 2] * y;
449 for(
sLong i=0; i<n; i++)
451 z += m_V[i] * _Get_Base_Funtion(m_Points[i], x, y);