⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cubicspline.cwp.lib

📁 su 的源代码库
💻 LIB
字号:
CUBICSPLINE - Functions to compute CUBIC SPLINE interpolation coefficientscakima		compute cubic spline coefficients via Akima's method		  (continuous 1st derivatives, only)cmonot		compute cubic spline coefficients via the Fritsch-Carlson method		  (continuous 1st derivatives, only)csplin		compute cubic spline coefficients for interpolation 		  (continuous 1st and 2nd derivatives)chermite	compute cubic spline coefficients via Hermite Polynomial		  (continuous 1st derivatives only)Function Prototypes:void cakima   (int n, float x[], float y[], float yd[][4]);void cmonot   (int n, float x[], float y[], float yd[][4]);void csplin   (int n, float x[], float y[], float yd[][4]);void chermite (int n, float x[], float y[], float yd[][4]);Input:n		number of samplesx  		array[n] of monotonically increasing or decreasing abscissaey		array[n] of ordinatesOutput:yd		array[n][4] of cubic interpolation coefficients (see notes)Notes:The computed cubic spline coefficients are as follows:yd[i][0] = y(x[i])    (the value of y at x = x[i])yd[i][1] = y'(x[i])   (the 1st derivative of y at x = x[i])yd[i][2] = y''(x[i])  (the 2nd derivative of y at x = x[i])yd[i][3] = y'''(x[i]) (the 3rd derivative of y at x = x[i])To evaluate y(x) for x between x[i] and x[i+1] and h = x-x[i],use the computed coefficients as follows:y(x) = yd[i][0]+h*(yd[i][1]+h*(yd[i][2]/2.0+h*yd[i][3]/6.0))Akima's method provides continuous 1st derivatives, but 2nd and3rd derivatives are discontinuous.  Akima's method is not linear, in that the interpolation of the sum of two functions is not the same as the sum of the interpolations.The Fritsch-Carlson method yields continuous 1st derivatives, but 2ndand 3rd derivatives are discontinuous.  The method will yield a monotonic interpolant for monotonic data.  1st derivatives are set to zero wherever first divided differences change sign.The method used by "csplin" yields continuous 1st and 2nd derivatives.References:See Akima, H., 1970, A new method for interpolation and smooth curve fitting based on local procedures,Journal of the ACM, v. 17, n. 4, p. 589-602.For more information, see Fritsch, F. N., and Carlson, R. E., 1980, Monotone piecewise cubic interpolation:  SIAM J. Numer. Anal., v. 17,n. 2, p. 238-246.Also, see the book by Kahaner, D., Moler, C., and Nash, S., 1989, Numerical Methods and Software, Prentice Hall.  This function was derived from SUBROUTINE PCHEZ contained on the diskette that comes with the book.For more general information on spline functions of all types see the book by:Greville, T.N.E, 1969, Theory and Applications of Spline Functions,Academic Press.Author:  Dave Hale, Colorado School of Mines c. 1989, 1990, 1991

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -