[TAG] Brother, can you spare a function?
Kapil Hari Paranjape
kapil at imsc.res.in
Fri Sep 17 19:44:01 MSD 2010
On Fri, 17 Sep 2010, Ben Okopnik wrote:
> I've been losing a lot of weight lately,
Something I've been trying to do for a while. So unless its for all
the wrong reasons, congratulations!
> What I'd really, really like to have is a function that takes the
> above list and returns the weight value for any given point in time
> between Tmin and Tmax; I'm sure that it's a standard mathematical
> function, but I don't know how to implement it.
I'm still not sure exactly what you want. Suppose we have two points
(date,weight)=(d,w); (later date, later weight)=(d';w') then to get
the value of weight by _linear_ interpolation between these two at the
date e which is between d and d' that is given by
(e-d)/(d'-d) w + (d'-e)/(d'-d) w'
Perhaps that is the formula that you want. The way to remember this
is to note that it divides the interval between w and w' in the same
proportion as e divides the interval between d and d'.
More information about the TAG