function getEquallySpacedData(x, y, options) {
        if (x.length>1 && x[0]>x[1]) {
            x=x.slice().reverse();
            y=y.slice().reverse();
        }

        var xLength = x.length;
        if(xLength !== y.length)
            throw new RangeError("the x and y vector doesn't have the same size.");

        if (options === undefined) options = {};

        var from = options.from === undefined ? x[0] : options.from
        if (isNaN(from) || !isFinite(from)) {
            throw new RangeError("'From' value must be a number");
        }
        var to = options.to === undefined ? x[x.length - 1] : options.to;
        if (isNaN(to) || !isFinite(to)) {
            throw new RangeError("'To' value must be a number");
        }

        var reverse = from > to;
        if(reverse) {
            var temp = from;
            from = to;
            to = temp;
        }

        var numberOfPoints = options.numberOfPoints === undefined ? 100 : options.numberOfPoints;
        if (isNaN(numberOfPoints) || !isFinite(numberOfPoints)) {
            throw new RangeError("'Number of points' value must be a number");
        }
        if(numberOfPoints < 1)
            throw new RangeError("the number of point must be higher than 1");

        var algorithm = options.variant === "slot" ? "slot" : "smooth"; // default value: smooth

        var output = algorithm === "slot" ? getEquallySpacedSlot(x, y, from, to, numberOfPoints) : getEquallySpacedSmooth(x, y, from, to, numberOfPoints);

        return reverse ? output.reverse() : output;
    }
Function that returns a Number array of equally spaced numberOfPoints
containing a representation of intensities of the spectra arguments x
and y.

The options parameter contains an object in the following form:
from: starting point
to: last point
numberOfPoints: number of points between from and to
variant: "slot" or "smooth" - smooth is the default option

The slot variant consist that each point in the new array is calculated
averaging the existing points between the slot that belongs to the current
value. The smooth variant is the same but takes the integral of the range
of the slot and divide by the step size between two points in the new array.

@param x - sorted increasing x values
@param y
@param options
@returns {Array} new array with the equally spaced data.