I'm writing a javascript game, and are working on some interpolation functions, but I don't have enough mathematical knowledge to work out this problem.
I want to use a cubic function for interpolation with this formula:
y=ax^3 + bx + c
I want to find a using two points [x1,y1] [x2,y2]
b and c are known values.
bis the 'slope' of the equation, and determines how 'curved' the returned results are (sorry about the bad explanation), and is set by the programcis equal to y2
Is it possible to solve for a, using only these two points?
My ultimate goal is to interpolate (or map) any value x, that is between x1 and x2, to a value between y1 and y2, in a non-linear way, determined by this equation.
Let me know if I need to explain some things better.
Edit: Example of how it would work:
Points are defined as [0,0] [100,1000]
Given an x-value 50, a linear interpolation would return 500.
A non-linear interpolation (possibly cubic) would, depending on the slope, return a value higher or lower than 500.