I have a function that eases values with ranges of 0 to 1. The real world values are 0 to 230 and 230 to 0 how do I call the function with the proper "subdecimal converted" value and convert the output back into an integer? Time is also handled outside the function
x=0
timer=0 /milliseconds/
while x < 230
<convert x to something the function can use, probably distance / time?)
x=function(x)
<convert x back to the real world pixel value>
object.moveto(x,100)
end while
and what is the proper terminology for this type of conversion?
Unless I'm misunderstanding, are you just wanting to scale a 0..230 value to 0..1?
To scale linearly use
x = function(x/230.0) * 230.0
and round if necessary to convert to an integer (you didn't state what language you're using)
If you need to scale some other way (exponentially, logarithmically, etc.) the formula would be different.