The functions from src/math in the d3 repo