HP Prime: Hermite Interpolation – 2 Points Known - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: HP Prime: Hermite Interpolation – 2 Points Known (/thread-5699.html) |
HP Prime: Hermite Interpolation – 2 Points Known - Eddie W. Shore - 02-17-2016 01:13 PM Link to Blog Entry: http://edspi31415.blogspot.com/2016/02/hp-prime-hermite-interpolation-2-points.html The 2-Known Points Case We have points (x0, y0, y’0) and (x1, y1, y’1) and we want to determine y for a given value of x. The approximation of y is determined by divided differences. Code:
And y = H3(x) = y0 + y’0 * (x – x0) + z02 * (x – x0)^2 + z13 * (x – x0)^2 * (x – x1) Program: Code: EXPORT HERMITE2(x0,y0,dy0,x1,y1,dy1,x) Example: Given: x0 = 0, y0 = 0, y’0 = 1; x1 = 1, y1 = 1, y’1 = 0.78 For x = 0.5, result is y = 0.5275 For x = 0.78, result is y = 0.80944656 Source: Faires, J. Douglas and Burden, Richard. Numerical Methods – 3rd Edition Thompson Brooks/Cole: Pacific Grove, CA 2003 |