Added support for different slopes
Simplified formulas for rect. and triangular sections