Painting with Linear Factors
Author: Scott Farrar, adapted from Riley Lark
Date: 5 December 2013

Orange is a quintic with all real roots.  Green is a quadratic with two real roots.  f(x) = orange/green

f(x) = \frac{orange}{green}

show f(x)

show orange

show green

A = Point(xAxis)
B = Point(xAxis)
C = Point(xAxis)
D = Point(xAxis)
E = Point(xAxis)
f(x) = x - x(A)
g(x) = x - x(B)
h(x) = x - x(C)
p(x) = x - x(D)
q(x) = x - x(E)
a = 0.2 (slider from -1 to 1, step 0.01)
r(x) = a * (x - x(A)) * (x - x(B)) * (x - x(C)) * (x - x(D)) * (x - x(E))
F = Point(xAxis)
G = Point(xAxis)
s(x) = x - x(F)
t(x) = x - x(G)
f_1(x) = s(x) * t(x)
g_1(x) = r(x) / f_1(x)
b = false
c = true
d = true