From time to time, especially if I make some proof of concept games or anything real-time in nature I quickly need to generate values between known wanted values.

Exactly what a function does, right?

Well, some things are not easily expressed as a function. You might *know* where you want some item at a discrete set of points in time, and you simply want the item to get there from the previous position in time.

Enter *extraploation*!

"In mathematics, extrapolation is the process of estimating, beyond the original observation interval, the value of a variable on the basis of its relationship with another variable" - http://en.wikipedia.org/wiki/Extrapolation

To do this relatively easily I wrote a small JavaScript module:

https://github.com/AlexanderBrevig/Extrapolate.js

You can set it up like this:

```
// create an object for training
var extrapolate = new EXTRAPOLATE.LINEAR();
// for this example, ket's keep it simple
// f(x) = 2x
extrapolate.given(0).get(0);
extrapolate.given(1).get(2);
extrapolate.given(2).get(4);
extrapolate.given(4).get(8);
extrapolate.given(5).get(10);
```

Then you can ask for extrapolated values like this:

```
extrapolate.valueFor(-1); // -2
extrapolate.valueFor(2); // 4
extrapolate.valueFor(10); // 20
```

A graphical implementation of this, some sort of simple 2D game in which you can walk around and have the code predict your most likely path, drawing a matching curve for the path you have already walked, and the probable path, would be a lovely way to see this in action.

What type of functions can this module detect?