There are multiple ways to calculate slope.
Firstly, if you have a graph, it is rise over run. (Also y2-y1/x2-x1) this calculates the difference between 2 points on both their x and y axis, so they are the same.
Also from equation form.
Y=mx+b (the m is the slope)
ax+by= (-a/b is the slope)