GetExtrema function

Identify all the local extrema of a curve with a grid search