@noob
could not understand (x1,x2) = (-1,1)
(y1,y2) = (0,0) - line passes through the origin
(0-0)/(1-(-1))
0/2 = 0
I just picked two points that lie on the line to calculate the slope.
1st point that lies on the line (x1,x2) = (-1,1)
x1 is the x - co-ordinate and x2 is the y - co-ordinate of the point.
2nd point that lies on the line (y1,y2) = (0,0)
since the line passes through the origin.
y1 is the x- co-ordinate and y2 is the y - co-ordinate of the point.
Now using these two sets of points (which lie on the line), calculated the slope.
slope (m) = (y2-y1)/(x2-x1)