src/third_party/specimenTools/lib/bower_components/Atem-Pen-Case/lib/tools/decomposeSuperSegments.js
/**
    * Split the quadratic curve segment described by 'points' into a list
    * of "atomic" quadratic segments. The 'points' argument must be a list
    * with length 2 or greater, containing [x, y] coordinates. The last point
    * is the destination on-curve point, the rest of the points are off-curve
    * points. The start point should not be supplied.
    *
    * This function returns a list of [pt1, pt2] lists, which each specify a
    * plain quadratic bezier segment.
    */
Split the quadratic curve segment described by 'points' into a list
of "atomic" quadratic segments. The 'points' argument must be a list
with length 2 or greater, containing [x, y] coordinates. The last point
is the destination on-curve point, the rest of the points are off-curve
points. The start point should not be supplied.

This function returns a list of [pt1, pt2] lists, which each specify a
plain quadratic bezier segment.
Split the quadratic curve segment described by ' points ' into a list of " atomic " quadratic segments . The ' points ' argument must be a list with length 2 or greater containing [ x y ] coordinates . The last point is the destination on - curve point the rest of the points are off - curve points . The start point should not be supplied . This function returns a list of [ pt1 pt2 ] lists which each specify a plain quadratic bezier segment .
function decomposeQuadraticSegment(points) {
        var n = points.length - 1,
            quadSegments = [],
            i, x, y, nx, ny, impliedPt;
        assert(n > 0, 'Expecting at least 2 Points here');
        for (i=0;i<n-1;i++)
        {
            x = points[i][0];
            y = points[i][1];
            nx = points[i+1][0];
            ny = points[i+1][1];
            impliedPt = [0.5 * (x + nx), 0.5 * (y + ny)];
            quadSegments.push([points[i], impliedPt]);
        }
        quadSegments.push( [points[points.length-2], points[points.length-1]] );
        return quadSegments;
    }
function decomposeQuadraticSegment ( points ) { var n = points . length - 1 , quadSegments = [ ] , i , x , y , nx , ny , impliedPt ; assert ( n > 0 , 'Expecting at least 2 Points here' ) ; for ( i = 0 ; i < n - 1 ; i ++ ) { x = points [ i ] [ 0 ] ; y = points [ i ] [ 1 ] ; nx = points [ i + 1 ] [ 0 ] ; ny = points [ i + 1 ] [ 1 ] ; impliedPt = [ 0.5 * ( x + nx ) , 0.5 * ( y + ny ) ] ; quadSegments . push ( [ points [ i ] , impliedPt ] ) ; } quadSegments . push ( [ points [ points . length - 2 ] , points [ points . length - 1 ] ] ) ; return quadSegments ; }
Split the quadratic curve segment described by 'points' into a list
 of "atomic" quadratic segments.
Split the quadratic curve segment described by ' points ' into a list of " atomic " quadratic segments .
//the keys of the list are strings, what makes i+1 == '01'