function pointsToCoordArray(points) {
        var coodinatesArray = new Array(points.length * points[0].length);
        var k = 0;
        for(var i = 0; i < points.length; ++i) {
            for(var j = 0; j < points[0].length; ++j) {
                coodinatesArray[k] = points[i][j];
                ++k;
            }
        }

        return coodinatesArray;
    }
Function that transform an array of points into a coordinates array
as follows:
[x1, y1, .. , x2, y2, ..]

@param points
@returns {Array}