recently I stumbled upon a Sarah Frisken's efficient curve fitting algorithm. Would really love to see your explaination and implementation of it. https://scholar.harvard.edu/files/sfrisken/files/efficient_curve_fitting.pdf