I found the idea for this project in C #. When creating games, it is sometimes necessary to linearly interpolate between two values. This is done using the Lerp function. Linear interolation is the search for a value that is a certain percentage between two values. For example, we could linearly interpolate between 3 and 5 by 50% to get 4. This is because 4 is 50% of the path between 3 and 5. I decided to recreate this function in JavaScript. This function takes three parameters: the first "from" which to interpolate, the second "to" which must be interpolated, and the third shows "how far" to interpolate. In my example, 0.5 will be 50% => 1 = 100%, and 0 => 0%, etc. Function - https://danielpetelin.github.io/Interpolation/
danielpetelin / interpolation Goto Github PK
View Code? Open in Web Editor NEWI made an interpolation function in JavaScript.
Home Page: https://danielpetelin.github.io/Interpolation/