The functions from src/interpolate in the d3 repo