Loading...
Logo
Processing Forum
If I have a slope (m) and the y intercept (b), for the equation, y = mx + b, can I draw a simple line using these in processing?

Replies(2)

Yes, of course, it is really simple.
Copy code
  1. float m=.2,b=20,c=220;size(440,440);background(-1);translate(c,c);
  2. line(0,-c,0,c);line(-c,0,c,0);stroke(c,0,0);line(-c,-(m*-c+b),c,-(m*c+b));