route_slope_matrix function

Calculate the gradient of line segments from a matrix of coordinates