Calculates the slope of a vector.