Determining a 2nd degree function