Linear interpolation, C#


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. static double interpolate( double x0, double y0, double x1, double y1, double x )
  2. {
  3. return y0*(x - x1)/(x0 - x1) + y1*(x - x0)/(x1 - x0);
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.