Algorithm to find slope of line with a modulus
As I understand it, the best way should just be to take the known maximum - minimum as your change in y, and the period length as the change in x (assuming the function you've described is periodic, with its domain as ℝ), and their ratio is the slope.  Since you're dealing with discrete points, you'd just need enough data to estimate the shape of two periods to solve for the period length, but more is obviously better.