Spline hermit (Hermite) interpolation function

Source: Internet
Author: User

Core code:

//////////////////////////////////////// //// // ///////////Hermit equi-distance interpolation ///// //////////////////////////////////////// //// // static float getvaluehermite (const void * valuesptr, int stride, int N, float T, float DC) {int I, j; float Z, S, P, Q, V, D; // Initial Value z = 0.0; // special case processing if (n <1) {return (z);} If (n = 1) {z = yfgetfloatvalue (valuesptr, stride, 0 ); return (z);} float xste P = 1.0f/(n-1); // cyclic interpolation for (I = 1; I <= N; I ++) {S = 1.0f; q = (I-1) * xstep; For (j = 1; j <= N; j ++) {P = (J-1) * xstep; If (J! = I) {S = S * (t-P)/(Q-p) ;}} S = S * s; P = 0.0f; For (j = 1; j <= N; j ++) {If (J! = I) {P = P + 1.0f/(Q-(J-1) * xstep);} v = yfgetfloatvalue (valuesptr, stride, I-1 ); if (I <n) {d = yfgetfloatvalue (valuesptr, stride, I)-V;} else {d = V-yfgetfloatvalue (valuesptr, stride, I-2 );} Q = V + (t-q) * (D * dc-2.0f * V * P); Z = z + Q * s;} return (z );}

Cut graph:

 

 

Related Software: http://files.cnblogs.com/WhyEngine/TestSpline.zip

Spline hermit (Hermite) interpolation function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.