in reply to Re: Interpolating data slope for multiple points
in thread Interpolating data slope for multiple points

{grin} "Simple", he calls it. Thanks, GrandFather - I appreciate the suggestion! I'm going to keep trying, and maybe I'll come up with something a little less complicated yet. It really shouldn't be this difficult...

As to '%s' being non-standard, point taken. I saw the warning in the POSIX docs, but figured "what the heck". Your approach is definitely more robust.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf
  • Comment on Re^2: Interpolating data slope for multiple points

Replies are listed 'Best First'.
Re^3: Interpolating data slope for multiple points
by GrandFather (Saint) on Sep 17, 2010 at 05:47 UTC

    Think about what makes the code difficult for a moment. You have non-uniformly sampled data and you want to fill in the gaps. That means that you have to account for possible special cases at the start and end of the data and you have to ensure you are using the correct points in between. There is a limit to how much you can make that processing simple.

    If you focus on the interpolation loop in my code you will see that:

    1. the start point is handled uniformly with the interpolated points.
    2. raw data is thrown away while the epoch for the current point to be calculated is greater than the second raw data point in the list. That gets us the appropriate pair of points to interpolate between.
    3. the last point is by definition the last point in the raw list and is handled as a special case.

    Where's the problem? {grin}

    True laziness is hard work
      Where's the problem? {grin}

      In my horribly deficient math skills, I suppose. I really should sail over to an uninhabited island and spend the next six months relearning math so I can stop embarassing myself in public. :)

      Thanks again.


      --
      "Language shapes the way we think, and determines what we can think about."
      -- B. L. Whorf