linearInterpolation

Functions

double linearInterpolation(double x1, double x2, double y1, double y2, double x)

This function uses linear interpolation to solve for the value of an unknown function of a single variables f(x) at the point x.

Parameters:
  • x1 – Data point x1

  • x2 – Data point x2

  • y1 – Function value at point x1

  • y2 – Function value at point x2

  • x – Function x coordinate for interpolation

Returns:

double