Compute the x and y coordinate of the Point P(t=0.2)P(t=0.2) on the cubic B-Spline
P(t)=∑nk=1PkBk,4(t)P(t)=∑k=1nPkBk,4(t)
Control Points: P1P1 = ( 3|5), P2P2 = ( 6|6), P3P3 = ( 7|10), P4P4 = ( 20|11)
Use the following blending functions
B0,4=16(1−3t+3t2−t3)B0,4=16(1−3t+3t2−t3)
B1,4=16(4−6t2+3t3)B1,4=16(4−6t2+3t3)
B2,4=16(1+3t+3t2−3t3)B2,4=16(1+3t+3t2−3t3)
B3,4=16(t3)B3,4=16(t3)
Px =
PY=
Show in steps complete calculation
Here is a matlab code just to solve in one click,
B = zeros (4,4)
%t = [0:0.1:1]
t = 0.2;
B(1,4) = 16*(1-3*t+3.*t.^2-t.^3) %B0,4 In matlab index starts from
1 not from 0
B(2,4) = 16*(4-6.*t.^2+ 3.*t.^3) %B1,4
B(3,4) = 16*(1+3*t+3.*t.^2-3*t.^3) %B2,4
B(4,4) = 16*t.^3 %B3,4
xt = [3, 6,7,10]
yt = [5,6,10,11]
Px = 0;
Py = 0;
for i = 1 : 4
Px = Px +xt(i).*B(i,4) ;
Py = Py + yt(i).*B(i,4);
end
Px
Py
The answers for Px and Py at t = 0.2, t = 0.2 are,
Px(t=0.2) = 579.0720
Py(t=0.2) = 676.9920
Get Answers For Free
Most questions answered within 1 hours.