You are on page 1of 2

Mathematical Elements for Geometrical Modelling

Assignment no 1
Name: - Gaikwad Shantanu Rajendra

Problem Description:Draw Hermite and Bezier curve using at least 20 point.

Twenty Points:Serial No.


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.

Hermite Curve
X coordinate
1
1.6098
2.5180
3.6933
5.1040
6.7188
8.5060
10.4342
12.4720
14.5878
16.7500
18.9272
21.0880
23.2007
25.2340
27.1563
28.9360
30.5418
31.9420
33.1052
34.0000

Y coordinate
2
2.8152
3.9420
5.3518
7.0160
8.9063
10.9940
13.2507
15.6480
18.1573
20.7500
23.3977
26.0720
28.7442
31.3860
33.9688
36.4640
38.8433
41.0780
43.1397
45.0000

Bezier Curve
X coordinate
Y coordinate
1
2
2.3508
3.8222
3.7060
5.4180
5.0702
6.8308
6.4480
8.1040
7.8438
9.2813
9.2620
10.4060
10.7072
11.5217
12.1840
12.6720
13.6968
13.9003
15.2500
15.2500
16.8482
16.7647
18.4960
18.4880
20.1977
20.4632
21.9580
22.7340
23.7813
25.3438
25.6720
28.3360
27.6348
31.7543
29.6740
35.6420
31.7943
40.0428
34.0000
45.0000

For Bezier curve multiply by 3 times to tangent of hermite curve.

Matlab code:p0=[1 2];


p1=[34 45];
p2=[10 15];
p3=[19 10];

M=[2 -2 1 1;-3 3 -2 -1;0 0 1 0;1 0 0


0]; p=[p0; p1; p2-p0; p1-p3];
Q=[p0; p1; 3*(p2-p0); 3*(p1p3)]; u=0; du=0.05; n=1/du;
for i=1:n+1
t=[u^3 u^2 u
1]; a=t*M*p
b=t*M*Q
plot(a(1,1),a(1,2),'r')
plot(b(1,1),b(1,2),'k')
hold on;
u=u+du;
end
xlabel('X Axis')
ylabel('Y Axis')
legend( 'Bezier Curve','Hermite Curve', 'location', 'northwest');

Above code is for 20 points. (du=0.05)


Graph:-

For above graph use more than 20 points.

You might also like