function pingpong( x, length = 1 ) {

	// https://www.desmos.com/calculator/vcsjnyz7x4

	return length - Math.abs( euclideanModulo( x, length * 2 ) - length );

}
Returns a value that alternates between `0` and the given `length` parameter.

@param {number} x - The value to pingpong.
@param {number} [length=1] - The positive value the function will pingpong to.
@return {number} The alternated value.