I am new to Python 3D fitting, and the related optimisation techniques. I tried to understand similar topics and to find an answer based on least squares methods, but my success has been rather limited.
Problem: I have a number (ca. 400) of 3D points stored in a np array.
data = np.array([[x1, y1, z1], [x2, y2, z2], [x3, y3, z3], [x4, y4, z4], ... ])
I would like to fit a polynomial surface (order 2 or 3) to these points, and then get the parameters of the surface equation, so I could calculate z for any given pair of (x, y) values. For example:
z = (A * x ** 2) + (B * y ** 2) + (C * x * y) + (D * x) + (E * y) + F
I need to get an output that would contain the A, B, C, D, E, and F parameters. Is there a nice 'Pythonic' way of doing this?
Copyright Notice:Content Author:「Bart M」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63262910/fitting-3d-data-points-to-polynomial-surface-and-getting-the-surface-equation-ba