function isConvex(data) {

    var center = getIntersection([0, 0, data[2], data[3], data[0], data[1], data[4], data[5]]);

    return center &&
        (data[2] < center[0] == center[0] < 0) &&
        (data[3] < center[1] == center[1] < 0) &&
        (data[4] < center[0] == center[0] < data[0]) &&
        (data[5] < center[1] == center[1] < data[1]);

}
Checks if curve is convex. Control points of such a curve must form
a convex quadrilateral with diagonals crosspoint inside of it.

@param {Array} data input path data
@return {Boolean} output