equation for a straight line
This is known as y=mx+c where * y = Y position * m = steepness/gradient of the line * x = X position * c = y intercept
There are other variations

When given two points (x1,y1) and (x2,y2) then you work out m by doing
m = (y2-y1) / (x2-x1)