How would you express the common line equation programmatically. for example say if you have a straight line across the screen is there a way to work out the gradient. ect..