This is an effort to detect and fit a set of points to an ellipse. I have a method to take x,y data and generate a conic formula, but due to the nature of the polynomial there are 2 solutions for Y
Example: 1x² +-0.008xy +0.976y² + -316.916x +-151.345y + 27708.8 = 0
I have a Method to get the Y value for both solutions, but the primary issue is with the nature of a conic. Near the edges, small changes in X result in large changes in Y. This creates an issue when fitting the original x,y coordinates to the conic. Most point data will result in whole integers and now in order to best fit to the conic, the x values need to be transformed in some way that escapes me.
I found a rough solution, but it just throws a huge amount of x,y data at the polynomial to see what has a solution. I could do this and then just find the closest point to my original data to fit to the conic, but this just seems stupid. Has to be a better way.
At a minimum If I can find the max an min of a conic then I can minimize the number of possible data points but even that seems dumb.
Any help on how to fit existing data to a conic polynomial would be awesome and greatly appreciated.