   Newbie maths question
  I just cant think of a good way to do this.Perfect number for 500 and above is 50.Perfect number for 50 and below is 0.1.How do I find the perfect number for any point between 0 to 1000?Anyone can help me?   
  You're not giving enough information. Presumablyif (number >= 500): return 50if (number <= 50): return 0.1return 15isn't what you want.You've got two points on a scatter plot and your asking for a function, which has to say something about all the points in between. Should that function look like a line? If so, you'll want to solve for the equation of the line, which isn't too tricky. y = slope * x + y-intercept50 = slope * 500 + y-intercept0.1 = slope * 50 + y-interceptslope = (50 - y-intercept) / 5000.1 = ((50 - y-intercept) / 500) * 50 + y-intercept...y-intercept = -5.444444444 (repeating)slope = 0.110888888888 (repeating)return slope * number + y-interceptMaybe you wanted something to do with http://en.wikipedia.org/wiki/Perfect_number , or you wanted to use something besides linear interpolation (http://en.wikipedia.org/wiki/Linear_interpolation) between the points?   ;  Thanks for reply.I am not looking for 'perfect number' in a maths sense.I meant I want to find the perfect number that fits my purpose.Yea I guess I need something like lerp but I dont think the result would be a straight line.I am not really sure. I got two points to work with anyway which are 0.1 and 50   ;  Maybe if you posted what the number is being used for? And where the numbers you do have came from?   ;  500 is to do with FPS and 50 is a lerp value for smoothing movement.So as the FPS decreases the application can use a lower value to lerp movement.I have tested those 2 cases (50 fps at 0.1 and 500 fps at 50) and they produce satisfactory results.Now I just need to know the values in between.   ;  Find good values for 100, 150, 200 and 350 by hand. That should give you an idea of how to interpolate.   