Fergusonova interpolačná kubická krivka
Author: Daniela Velichova

FERGUSONova kubika je interpolačná krivka určená
začiatočným bodom P_0, koncovým bodom P_1, 
smerovým vektorom dotyčnice a_0 v začiatočnom bode
a smerovým vektorom dotyčnice a_1 v koncovom bode,
a štyrmi Hermitovymi polynómami tretieho stupňa p_0(t), p_1(t), q_0(t), q_1(t). 
Analytická reprezentácia Fergusonovej kubiky je
vektorová funkcia r(t) definovaná na jednotkovom intervale v R. 

r(t) = P_0 (2 t³ - 3 t² + 1) + P_1 (-2 t³ + 3 t² + t) + a_0 ( t³ - 2 t² + t) + a_1( t³ - t² ) = (x(t), y(t)

ya_0 = -1 (slider from -5 to 5, step 0.1)
xa_0 = 0.7 (slider from -5 to 5, step 0.1)
ya_1 = 0.9 (slider from -5 to 5, step 0.1)
xa_1 = 0.3 (slider from -5 to 5, step 0.1)
yp_1 = 1.579753086419753 (slider from 0 to 5, step 0.1)
xp_1 = 2.322962962962963 (slider from 0 to 5, step 0.1)
xp_0 = 0.659753086419753 (slider from 0 to 5, step 0.1)
yp_0 = 1.7 (slider from 0 to 5, step 0.1)
f(x) = 2.0 * x^(3.0) - 3.0 * x^(2.0) + 1.0
p_0 = Function(f, 0.0, 1.0)
f1(x) = -2.0 * x^(3.0) + 3.0 * x^(2.0)
p_1 = Function(f1, 0.0, 1.0)
f2(x) = x^(3.0) - 2.0 * x^(2.0) + x
q_0 = Function(f2, 0.0, 1.0)
f3(x) = x^(3.0) - x^(2.0)
q_1 = Function(f3, 0.0, 1.0)
P_1: (xp_1, yp_1)
P_0: (xp_0, yp_0)
D = (3, 1.5)
c = CurveCartesian(xp_0 * (2.0 * t^(3.0) - 3.0 * t^(2.0) + 1.0) + xp_1 * (-2.0 * t^(3.0) + 3.0 * t^(2.0)) + xa_0 * (t^(3.0) - 2.0 * t^(2.0) + t) + xa_1 * (t^(3.0) - t^(2.0)), yp_0 * (2.0 * t^(3.0) - 3.0 * t^(2.0) + 1.0) + yp_1 * (-2.0 * t^(3.0) + 3.0 * t^(2.0)) + ya_0 * (t^(3.0) - 2.0 * t^(2.0) + t) + ya_1 * (t^(3.0) - t^(2.0)), t, 0.0, 1.0)
P = Point(c)
t = Tangent(P, c)
E = Point(t)
a = Vector(P, E)
A: c(0.0)
B: c(1.0)
a_1 = Vector(P_1, P_1 + (xa_1, ya_1))
a_0 = Vector(P_0, P_0 + (xa_0, ya_0))
text3: "x(t)  =  " + xp_0 + "(2t^3-3t^2+1)+ " + xp_1 + "(-2t^3+3t^2)+ " + xa_0 + "(t^3-2t^2+t)+ " + xa_1 + "(t^3-t^2)  "
text4: "y(t) = " + yp_0 + "(2t^3-3t^2+1) + " + yp_1 + "(-2t^3+3t^2) + " + ya_0 + "(t^3-2t^2+t)+ " + ya_1 + "(t^3-t^2)"