Geoff,
Tediously I cannot seem to get even the simplest of trials to work ...
To me, this task does not seem that simple! By "best-fit surface" you probably want a plane. If so one can try to fit a two dimensional linear function:
pts = {{0, 0, 0}, {1, 0, 1}, {1, 1, 2}, {2, 2, 2}, {2, 4, 3}, {3, 6, 4}};
model = a x + b y + c;
params = FindFit[pts, model, {a, b, c}, {x, y}];
ptGrph = Graphics3D[{Red, Sphere[pts, .2]}];
Show[Plot3D[Evaluate[model /. params], {x, -1, 4}, {y, -1, 7},
PlotStyle -> Opacity[.8], BoxRatios -> Automatic,
AxesLabel -> {"X", "Y", "Z"}, ImageSize -> Large], ptGrph]
In case you require that all points lie exactly on the surface then I would suggest using an InterpolatingPolynomial
:
ipp = InterpolatingPolynomial[{Most[#], Last[#]} & /@ pts, {x, y}];
Show[Plot3D[ipp, {x, -1, 4}, {y, -1, 6}, PlotStyle -> Opacity[.8],
BoxRatios -> Automatic, AxesLabel -> {"X", "Y", "Z"},
ImageSize -> Large, PlotRange -> {-1, Automatic}], ptGrph]
I'm undertaking to learn Wolfram Language as a senior citizen, but better late than never I say.
Congrats! I can only strongly encourage you to do so!
Regards -- Henrik