Input Gradient (m) and Y-intercept (c). Graph has a large scale. This isn't meant to be a really precise and complex line plotter, simply a proof of concept.
Mathematics, without which this would be impossible. Duh.