Coons rational cubic curve
Author: Daniela Velichová

COONS rational cubic curve is determined by  
4 vertices P_0, P_1, P_2, P_3  of basic polygon 
with attached weights  h_0, h_1, h_2, h_3, 
and 4  Coons B-spline polynomials of degree 3
 p_0(t), p_1(t), p_2(t), p_3(t).

P = r(t) = 

r(t) = \sum_{i=0 }^{ 3} h_i P_i p_i(t)  /  \sum_{i=0 }^{ 3} h_i p_i(t)

t = 0.35 (slider from 0 to 1, step 0.01)
h_3 = 1 (slider from 0 to 100, step 0.1)
h_2 = 1 (slider from 0 to 100, step 0.1)
h_1 = 1 (slider from 0 to 100, step 0.1)
h_0 = 1 (slider from 0 to 100, step 0.1)
xp_0 = 3.248353596836273 (slider from -5 to 5, step 0.1)
yp_0 = 2.1818429872038996 (slider from -5 to 5, step 0.1)
xp_1 = 1.2829246895262516 (slider from -5 to 5, step 0.1)
yp_1 = 1.251489878548195 (slider from -5 to 5, step 0.1)
xp_2 = 1.3452293522940044 (slider from -5 to 5, step 0.1)
yp_2 = 2.425777033985578 (slider from -5 to 5, step 0.1)
xp_3 = 2.393080498842575 (slider from -5 to 5, step 0.1)
yp_3 = 2.4598143428388357 (slider from -5 to 5, step 0.1)
r = CurveCartesian((xp_0 * h_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + xp_1 * h_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + xp_2 * h_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + xp_3 * h_3 * t^(3.0) / 6.0) / (h_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + h_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + h_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + h_3 * t^(3.0) / 6.0), (yp_0 * h_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + yp_1 * h_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + yp_2 * h_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + yp_3 * h_3 * t^(3.0) / 6.0) / (h_0 * (-t^(3.0) / 6.0 + t^(2.0) / 2.0 - t / 2.0 + 1.0 / 6.0) + h_1 * (t^(3.0) / 2.0 - t^(2.0) + 2.0 / 3.0) + h_2 * (-t^(3.0) / 2.0 + t^(2.0) / 2.0 + t / 2.0 + 1.0 / 6.0) + h_3 * t^(3.0) / 6.0), t, 0.0, 1.0)
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
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)
f3(x) = x^(3.0) / 6.0
p_3 = Function(f3, 0.0, 1.0)
P: r(t)
t_1 = Tangent(P, r)
E = Point(t_1)
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_1)
A = Point(t_1)
a = Vector(P, A)
p_1 = Function(f1, 0.0, 1.0)
text3: P + ""