mathtools.divide_scalar_by_ratio — Abjad v1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »

# mathtools.divide_scalar_by_ratio

`abjad.tools.mathtools.` `divide_scalar_by_ratio`(scalar, ratio)

  Divide scalar proportionally by ratio. Return list of `len(ratio)` parts.

      abjad> mathtools.divide_scalar_by_ratio(Rational(1, 2), [1, 1, 3])
      [Rational(1, 10), Rational(1, 10), Rational(3, 10)]

      abjad> mathtools.divide_scalar_by_ratio(1, [1, 1, 3])
      [0.20000000000000001, 0.20000000000000001, 0.59999999999999998]

  Raise `TypeError` on nonnumeric scalar:

      abjad> mathtools.divide_scalar_by_ratio('foo', [1, 1, 3])
      TypeError

  Todo

  Do we want `mathtools.divide_scalar_by_ratio(1, [1, 1, 3])` to return rational values instead of floats?

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »