How to Find the Slope in the x direction and y direction