Hi HN,
For a robotics problem I have, I needed to determine the minimum distance between a point and an ellipse.
Existing stack overflow answers suggest using root finders to solve a quartic equation or specialised iterative methods that have instabilities.
https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
One paper suggests using an initial guess on the ellipse as a root of the quartic, using the guess to simplify it to a cubic, and then solving it. The result is a fast converging stable algorithm, but solving the cubic and choosing the correct root is gross.
I've come up with a method that relies on maths that most programmers would not be familiar with, but the implementation boils down to 14 lines of python. It converges quickly (3 iterations) and is completely robust (no divergences or divide by zeros).
This is the first time I've been sitting on an algo that I genuinely believe to be novel. The robotics is a side project and work doesn't lay claim to IP outside of work.
I intend to write up a blog post tomorrow, but if you were in my shoes what would you do?
Thanks