• Advertisement
Sign in to follow this  

Cubic interpolation problem

This topic is 4856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I discoverd that : // v0 = the point before a // v1 = the point a // v2 = the point b // v3 = the point after b float Cubic_Interpolate(float v0, float v1, float v2, float v3,float x) { float P = (v3 - v2) - (v0 - v1); float Q = (v0 - v1) - P; float R = v2 - v0; float S = v1; return Px3 + Qx2 + Rx + S; } gives NOT the right answer. When the four points is in line like: * * * * the return values will not follow that line, it returns a sine-like wave instead. What can I do to fix that? (The formula above is published in some documents I have read)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement