Slope calculaton and equations of motion (Derivatios)