Suppose we have a curve which is given by 3D points, for example:
(0.43, 0.55, 32.49), (0.61, 0.77, 31.24), (0.77, 1.01, 29.99), (0.88, 1.23, 28.75), (0.93, 1.41, 27.5), (0.91, 1.51, 26.25), (0.90, 1.59, 25), (0.81, 1.60, 23.75), (0.68, 1.58, 22.5), (0.46, 1.52, 21.25)
We try to figure out if there is a way to find the equation of the curve (it's coefficients and independent variable) by code in python, in a way that we can continue this curve to wherever we want? We had a few ideas to get the desired result by a projection to 2d with PCA and then taking a regression, but the result was poor
One way is to fit two sets of coordinates independently with one axis as the base. You can find the polynomial coefficients in
x_from_zandy_from_z.One caveat though: This works for this example, but may not work for other coordinates. For other examples, you may have to play around with the axis, that you use as a base (only z worked in this case), and the degree of the polynom for the polyfit-function (3 worked, but 4 has a better fit in this case). In some cases it may not work at all.