I’m building simple game and I need to set game speed for each level. Game speed increases for every next level. The thing is, I don’t want to have hard coded speed values for each level. I want to set starting game speed for the first level and the speed for the last level. All intermediate speed values for other levels should be calculated from the graph line going between those two, starting and ending, points. I’m putting some sketch that I have drawn on cartesian coordinate system on paper:

Y values are speed values and X values are level numbers. I need to init a line from two points (start and end), and need to get Y (speed) values for every needed X value. Does anybody have experience on that?
If you looking for a linear function f(x) = a.x + b such that:
where x1 is the starting level, x2 is the end level.
and
y1 is the starting speed and y2 is the starting speed
then the solution is:
You should check that calculation yourself one more time but it should be right
hope it answers your question