Added a function that calculates the slope of a line connecting two
points on a grid