mathtools.interpolate_divide_multiple

abjad.tools.mathtools.interpolate_divide_multiple.interpolate_divide_multiple(totals, key_values, exp='cosine')[source]

New in version 2.0.

Interpolate key_values such that the sum of the resulting interpolated values equals the given totals:

abjad> from abjad.tools import mathtools
abjad> mathtools.interpolate_divide_multiple([100, 50], [20, 10, 20]) # doctest: +SKIP
[19.4487, 18.5201, 16.2270, 13.7156, 11.7488, 10.4879,
9.8515, 9.5130, 10.4213, 13.0736, 16.9918]

The operation is the same as mathtools.interpolate_divide(). But this function takes multiple totals and key_values at once.

Precondition: len(totals) == len(key_values) - 1.

Set totals equal to a list or tuple of the total sum of interpolated values.

Set key_values equal a list or tuple of key values to interpolate.

Set exp to consine for consine interpolation.

Set exp to a number for exponential interpolation.

Returns a list of floats.

Changed in version 2.0: renamed interpolate.divide_multiple() to mathtools.interpolate_divide_multiple().

This Page