views:

84

answers:

1

I'm trying to write a function :
Input:
Source range, Source value, output range, curve type (Linear, smooth)
Output:
The output is the "source value" converted into the "output range"
according to the curve type.

I hope I am making sense here...

Any ideas ?
Thanks.

A: 

Do some research into B-splines. I think those will be able to sort you out. Or maybe a piecewise polynomial interpolation will be sufficient. Check out "Numerical Recipes in C" for code and examples.

duffymo