I've moved the function into Math.js but this is still relevant. @mramato