find the slope of the line AB and using it