well if they are sorted, or can be sorted, then they should be. It shouldnt eat that much CPU. If they are all doubles, then comparator functions should be cheap.

Well if they are sorted, the easiest way I see, is to just take pointn, pointn + 1andn - 1. You can also check pointsn +/- mwith weighted averages.

When the average of points n and those first, switches in greater/less than, you have a slope change.

So if n and m points slope before give a value greater than 0, then the slope is up/positive. if n and m points after give a negative slope, then somewhere between n-m and n+m there is a slope change like /`\. Same visa versa, except that would be \./ so it would be low point.

It is clear in my head, but I am known for not explaining things very well.

## Bookmarks