function linspace( x1, x2, len ) {
	var arr;
	var N;
	var d;
	var i;

	if ( len === 0 ) {
		return [];
	}
	// Calculate the increment:
	N = len - 1;
	d = ( x2-x1 ) / N;

	// Build the output array...
	arr = [ x1 ];
	for ( i = 1; i < N; i++ ) {
		arr.push( x1 + (d*i) );
	}
	arr.push( x2 );
	return arr;
}
Generates a linearly spaced numeric array.

@param {number} x1 - first array value
@param {number} x2 - last array value
@param {NonNegativeInteger} len - length of output array
@returns {Array} linearly spaced numeric array

@example
var arr = linspace( 0, 100, 6 );
// returns [ 0, 20, 40, 60, 80, 100 ]