dos_interp - dalefugier/DOSLib GitHub Wiki

Performs an interpolation between two numbers.

Syntax

(dos_interp min max val [mode])

Parameters

min

The minimum value in the range.

max

The maximum value in the range.

val

The normalized value (ranging between 0 and 1) between min and max. Values of outside this range result in extrapolation.

mode

The interpolation method to use.

Method Description
0 (default) Linear
1 Cosine
2 Smooth step
3 Acceleration
4 Deceleration

Returns

The result of the interpolation if successful.

nil on error.

Example

(setq val 0)
(while (<= val 1.0)
  (print (dos_interp 0 255 val))
  (setq val (+ val 0.1))
)
(princ)