function fiterror = ToFitParabola(fitparams,x,y,z)
predictedz = fitparams(1) + fitparams(2).*x + fitparams(3).*y + fitparams(4).*0.5*x.^2 + fitparams(5).*x.*y  + fitparams(6).*0.5*y.^2;
fiterror = sqrt(mean((predictedz-z).^2));