The class Extrema_GenExtPS calculates all the extremum distances between a single point, P, and a surface, S; i.e. it finds the location(s) L on the surface where the derivative of the distance D from the point P to location L on the surface S is zero.
I modified this class to calculate all the extremum locations between two points, P1 and P2, and the surface S; i.e. it finds the location(s) on the surface where the derivative of D1+D2 is zero, where D1 is the distance from P1 to L and D2 is the distance from P2 to L. (If P1=P2 then my code operates the same as the original Extrema_GenExtPS.)
When I tested the modified code, sometimes it would miss certain extrema - extrema that I knew must be there as a result analytically solving for the locations of L for certain canonical objects. I located the problem in Extrema_GenExtPS: it does not search for saddle points in the Perform method. It searches for initial guesses where a point is higher than its neighbors
- - -
- + -
- - -
and for initial guesses where the a point is lower than its neighbors
+ + +
+ - +
+ + +
but not saddle points
+ -
- X - or + X +
+ -
where X is greater than (+) or less then (-) its neighbors.
I know this addition was essential for the two point case, but I do not know if it is required for the one point case (Extrema_GenExtPS). Anyway, I wanted to pass this on.