Calculating slope of a line passing through two points