I have a numpy.poly1d that can be any arbitrary 1d polynomial. Given an arbitrary point P, I wish to find the perpendicular distance between the curve and the point, and the point on the curve where the shortest distance line intersects the curve, if the point P does not lie on the polynomial itself
Now I can do something like the question Distance between a point and a curve in python, by sampling a set of points. But I believe that won't be fast enough considering that I have <100000 polynomials and <1000000 points per polynomial that I wish to find that distances to. Can someone suggest a more optimal method?
Here is a sample image illustration of what I am looking for. Basically, given P and B(t) I wish to find the length of g(x) and point Q.
