expl power &key :y0 :y1 :base :return-type [Function]

Returns an exponential value between :y0 and :y1 according to power, which ranges from 0 to 1. When power is 0 :y0 is returned, when power is 1 :y1 is returned. :y0 and :y1 default to 0 and 1, respectively. :base determines the slope of the exponential curve, if it is less than 1 then the exponential curve is concave, otherwise a convex curve is produced. The default value of :base is 2. 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 either float, integer or ratio. float may be specified as a list (float digits) in which case the floating point return value will be rounded to digitnumber of places.

Example:

? (expl 0 5 1 1/256)
0.0

? (expl 1 5 1 1/256)
5.0

? (expl .5 5 1 1/256)
1.235

;;; create envelope ramping from 3 to .5

? (loop for i to 1 by .2 append (list i (expl i 3 .5 1/256)))
(0 3.0 0.2 1.31 0.4 0.76 0.6 0.58 0.8 0.51 1.0 0.5)

See Also:

explseg, explsegs, fit, rescale


Last Modified: 5-Mar-1998