Coonsova aproximačná kubika
Author: Daniela Velichová

COONSova kubika je aproximačná krivka 
určená riadiacim polygónom, ktorý tvoria  
štyri body P_0, P_1, P_2, P_3, 
a štyrmi Coonsovými B-splajn polynómami tretieho stupňa
 p_0(t), p_1(t), p_2(t), p_3(t).
Analytická reprezentácia Bézierovej kubiky je
vektorová funkcia r(t) definovaná na jednotkovom intervale v R. 

r(t) = \sum_{i=0 }^{ 3} P_i p_i(t) =P_0 (-t³/6 + t²/2 - t/2 + 1/6) + P_1 ( t³/2 - t² + 2/3) + P_2 (-t³/2 + t²/2 + t/2 + 1/6) + P_3 t³/6 = (x(t), y(t))

yp_3 = 2.0024691358024693 (slider from 0 to 5, step 0.1)
xp_3 = 2.6706172839506173 (slider from 0 to 5, step 0.1)
yp_2 = 2.2 (slider from 0 to 5, step 0.1)
xp_2 = 1.2000000000000002 (slider from 0 to 5, step 0.1)
yp_1 = 1.6113580246913581 (slider from 0 to 5, step 0.1)
xp_1 = 0.6834567901234568 (slider from 0 to 5, step 0.1)
yp_0 = 1.777283950617284 (slider from 0 to 5, step 0.1)
xp_0 = 2.1530864197530866 (slider from 0 to 5, step 0.1)
f(x) = -x^(3.0) / 6.0 + x^(2.0) / 2.0 - x / 2.0 + 1.0 / 6.0
p_0 = Function(f, 0.0, 1.0)
f1(x) = x^(3.0) / 2.0 - x^(2.0) + 2.0 / 3.0
p_1 = Function(f1, 0.0, 1.0)
f2(x) = -x^(3.0) / 2.0 + x^(2.0) / 2.0 + x / 2.0 + 1.0 / 6.0
p_2 = Function(f2, 0.0, 1.0)
c = CurveCartesian(xp_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + xp_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + xp_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + xp_3 * t^(3.0) / 6.0, yp_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + yp_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + yp_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + yp_3 * t^(3.0) / 6.0, t, 0.0, 1.0)
f3(x) = x^(3.0) / 6.0
p_3 = Function(f3, 0.0, 1.0)
P = Point(c)
t = Tangent(P, c)
E = Point(t)
P_0: (xp_0, yp_0)
P_1: (xp_1, yp_1)
a_1 = Segment(P_0, P_1)
P_2: (xp_2, yp_2)
b = Segment(P_1, P_2)
P_3: (xp_3, yp_3)
d = Segment(P_2, P_3)
B = Point(t)
P0: c(0.0)
P1: c(1.0)
A = Point(t)
a = Vector(P, A)
text3: "x(t)  =  " + xp_0 + "(-t^3/6+t^2/2-t/2+1/6)+ " + xp_1 + "(t^3/2-t^2+2/3)+ " + xp_2 + "(-t^3/2+t^2/2+t/2+1/6)+ " + xp_3 + "t^3/6  "
text4: "y(t)  =  " + yp_0 + "(-t^3/6+t^2/2-t/2+1/6)+ " + yp_1 + "(t^3/2-t^2+2/3)+ " + yp_2 + "(-t^3/2+t^2/2+t/2+1/6)+ " + yp_3 + "t^3/6  "