I want to write a computer program or subroutine to find the number of bends or maxima/minima on a plotted curve of points. How can I use the points defining the curve to do this. I would expect that the change in slope would tell me, but how significant of a change should I be looking for? I think this is the right approach. Any help would be appreciated.