Curve fitting with a degree of 2