How to calculate slope.