in reply to Re^2: operate on an array created in a subroutine
in thread operate on an array created in a while loop

The Excel curve is based on three control points, the Math::Interpolate one is based on five controls.

I presume that means the excel plot is using a quadratic interpolation (3 pts).

If that's true, then you need to set M:I to use a quadratic interpolation as well if you want the results to match closely. Even then, using a different set of data (5 pts instead of 3) will ensure that your interpolation is slightly different.

If you want it to be exact, you need to use the exact same input.

  • Comment on Re^3: operate on an array created in a subroutine

Replies are listed 'Best First'.
Re^4: operate on an array created in a subroutine
by captainentropy (Initiate) on Oct 16, 2013 at 21:12 UTC
    Based on what I've read (and this isn't official from Microsoft) Excel uses Bezier interpolation to create smooth curves from three or more points. I played around with polynomials and it never looked right. Increasing the number of controls points generated larger polynomial equations and the curves didn't look like what I want. That's how I learned about Beziers and subsequently splines. I tried both of those modules, and now the Interpolate one. Here is an example of Spline vs. Interpolate. Also in this graph is the Interpolate with three control points. As you can see the three points makes just a parabola (p<0). https://www.dropbox.com/s/9cnl1jp9zzzhh19/Interpolate_example1.1.pdf

    So far only Math::Interpolate has given me a shape that is close enough to what I need with 5 points (three real points and two that are guesses). The problem is the height of each point. That has to be right. Hence the need to scale.

Re^4: operate on an array created in a subroutine
by captainentropy (Initiate) on Oct 28, 2013 at 22:10 UTC
    Does this website ever post replies? I've replied to this a long time ago and it still isn't showing up.
        Nope. That's not it. I even opened the thread on other browsers that had never seen perlmonks. Thanks, though. I'll just have to get help elsewhere. This is way too much of a hassle.
        now I see what the problem was. The "read depth" configuration. Why is that an option even? Sigh. A link to the config page conveniently appeared this morning. Yah!