interp x env &key :scale :offset :return-type [Function]

Returns the interpolated y value of x in env with optional :scale and :offset values applied: f(x)*scale+offset. The type of the value returned normally depends on the type of the arguments specified to the function. Use :return-type to force the return value to be a specific type, either float, integer or ratio. float may also be specified as a list (float digits) in which case the floating point return value will be rounded to digitnumber of places.

Example:

? (interp 50 '(0 0 100 1) :scale 2 :offset 3)
4.0

See Also:

interpl, interpolation, lookup


Last Modified: 5-Mar-1998