f(x)=mx+q

f(x)-q=mx

m = 0.5 (slider from -5 to 5, step 0.1)
q = 4.5 (slider from -10 to 10, step 0.1)
g(x) = (m * x)
p(x) = q + (x * m)