Polynomial fitting for snakes.