The slope of a line passing through two points P x 1 y 1 and Q x 2 y 2 is given by m y 2 y 1 x 2 x 1. Calculating with python the slope and the intercept of a straight line from two points x1y1 and x2y2. You can use the calculator below to find the equation of a line from any two points.
A print intercept.
Plug the given values into the formula for a slope. The slope of a line passing through two points P x 1 y 1 and Q x 2 y 2 is given by m y 2 y 1 x 2 x 1. So the equation of a line we can write as y is equal to mx plus b. Of course you dont know what b is right now so you would put in the x and y.