function cubicToQuadratics(x0, y0, cx0, cy0, cx1, cy1, x1, y1) {
                // create the Cubic object and split it at its inflections
                var cubics = new Cubic(
                  new _main.default.Vector(x0, y0),
                  new _main.default.Vector(cx0, cy0),
                  new _main.default.Vector(cx1, cy1),
                  new _main.default.Vector(x1, y1)
                ).splitInflections();

                var qs = []; // the final list of quadratics
                var precision = 30 / SQRT3;

                // for each of the non-inflected pieces of the original cubic
                var _iteratorNormalCompletion = true;
                var _didIteratorError = false;
                var _iteratorError = undefined;
                try {
                  for (
                    var _iterator = cubics[Symbol.iterator](), _step;
                    !(_iteratorNormalCompletion = (_step = _iterator.next()).done);
                    _iteratorNormalCompletion = true
                  ) {
                    var cubic = _step.value;
                    // the cubic is iteratively split in 3 pieces:
                    // the first piece is accumulated in 'qs', the result.
                    // the last piece is accumulated in 'tail', temporarily.
                    // the middle piece is repeatedly split again, while necessary.
                    var tail = [];

                    var t3 = void 0;
                    for (;;) {
                      // calculate this cubic's precision
                      t3 = precision / cubic.quadError();
                      if (t3 >= 0.5 * 0.5 * 0.5) {
                        break; // not too bad, we're done
                      }

                      // find a split point based on the error
                      var t = Math.pow(t3, 1.0 / 3.0);
                      // split the cubic in 3
                      var start = cubic.split(t);
                      var middle = cubic.split(1 - t / (1 - t));

                      qs.push(start); // the first part
                      tail.push(cubic); // the last part
                      cubic = middle; // iterate on the middle piece
                    }

                    if (t3 < 1) {
                      // a little excess error, split the middle in two
                      qs.push(cubic.split(0.5));
                    }
                    // add the middle piece to the result
                    qs.push(cubic);

                    // finally add the tail, reversed, onto the result
                    Array.prototype.push.apply(qs, tail.reverse());
                  }
                } catch (err) {
                  _didIteratorError = true;
                  _iteratorError = err;
                } finally {
                  try {
                    if (!_iteratorNormalCompletion && _iterator.return != null) {
                      _iterator.return();
                    }
                  } finally {
                    if (_didIteratorError) {
                      throw _iteratorError;
                    }
                  }
                }

                return qs;
              }
@function cubicToQuadratics
@param {Number} x0
@param {Number} y0
@param {Number} cx0
@param {Number} cy0
@param {Number} cx1
@param {Number} cy1
@param {Number} x1
@param {Number} y1
@returns {Cubic[]} an array of cubics whose quadratic approximations
                   closely match the civen cubic.

converts a cubic curve to a list of quadratics.