double aaa=0.00, bbb=0.00;
aaa= y2-y1;
bbb= x2-x1;
gradient = aaa/bbb;
?
ty

Save that he doesn't check for division by zero.menkent wrote:the math is correct for the slope between (x1,y1) and (x2,y2) if that's what you're asking.
well, since one might just "copy" the above, i think the above is not correct.PhoeniX wrote:Or you could save some lines and just do;
gradient = y2-y1/x2-x1;