Minimising a quadratic curve with exhaustive search.