3D second degree polynomial fit

Hi,

there are a few examples how to fit a 3D straight line on data, but cannot figure out how to make a 3D polynomial fit on particle XYZ positions using ROOT. Can this be done in a relatively simple way?

Thank you

This seems to be a 3D fit, but not unsure how to change the fitting equation:
root.cern.ch/doc/v608/exampleFit3D_8C.html

Similarly:
root.cern.ch/doc/v608/multidimfit_8C.html