Saturday, January 19, 2008

Linear interpolation, C#

static double interpolate( double x0, double y0, double x1, double y1, double x )
{
return y0*(x - x1)/(x0 - x1) + y1*(x - x0)/(x1 - x0);
}

No comments: