algebraic
if you look at your problem as a parameter t
scaling of polynomial then it became clearer. For example you want the control points for part t=<0.25,0.5>
. That means we need form new control points representing the same curve with parameter u=<0.0,1.0>
. How to do it?
- write BEZIER as polynomial
each axis can be done separately in the same manner s lets us focus on x
-axis only. We have 4 BEZIER control points with x-coordinates (x0,x1,x2,x3)
. If we apply bernstein polynoms to form cubic polynomial we get:
x(t)= ( ( x0))
+ t*( (3.0*x1)-(3.0*x0))
+ t*t*( (3.0*x2)-(6.0*x1)+(3.0*x0))
+t*t*t*(( x3)-(3.0*x2)+(3.0*x1)-( x0))
- rescale parameter by substitution
Use linear interpolation for that so:
t0=0.25 -> u0=0.0
t1=0.50 -> u1=1.0
t=t0+(t1-t0)*(u-u0)/(u1-u0)
t=0.25+0.5*u
now rewrite the polynomial using u
instead of t
x(t)= ( ( x0))
+(0.25+u/2) *( (3.0*x1)-(3.0*x0))
+(0.25+u/2)^2*( (3.0*x2)-(6.0*x1)+(3.0*x0))
+(0.25+u/2)^3*(( x3)-(3.0*x2)+(3.0*x1)-( x0))
- change the polynomial form to match BEZIER equation again
Now you need to separate terms of polynomial for u^0,u^1,u^2,u^3
and reform each to match BEZIER style (from #1). From that extract new control points.
For example term u^3 is like this. The only possibility of getting u^3 is from
(1/4+u/2)^3= (1/8)*u^3 + (3/16)*u^2 + (3/32)*u + (1/64)
so separated u^3
term will be:
u*u*u*(( x3)-(3.0*x2)+(3.0*x1)-( x0))/8
the others will be a bit more complicated as you need combine all lines together ... After simplifying you will need to separate the new coordinates. As you can see it is slight madness but there are algebraic solvers out there like Derive for Windows ...
Sorry I do not have time/mood/stomach to make full example of all the terms but you will see it will be quite a polynomial madness...