How to back calculate x based on a smoothed f(x)

26 Views Asked by At

I am trying to develop a widget that helps you define a function visually. So you could add various points on a graph and have the whole function for each x be calculated based on these points.

enter image description here

If I apply quadratic or cubic smoothing I would get:

enter image description here

a and b are easily calculated and even values in between with simple linear interpolation.

How would I calculate a' and b'?

(In the drawings, placement of a, b, a', b' looks like they are values of x, but they are actually supposed to be f(x) at points marked with a cross on the curve)