Anda di halaman 1dari 2

FUNCTION FILE

function [ output_args ] = hermite( input_args )


t=linspace(0,1);
x1=input ('x-coordinate of 1st point')
x2=input ('x-coordinate of 2nd point')
y1=input ('y-coordinate of 1st point')
y2=input ('y-coordinate of 2nd point')
thetha1= input ('angle of first vector')
thetha2= input ('angle of second vector')
m= input ('magnitude of vector')
a1=m*cos(thetha1)
a2=m*cos(thetha2)
v1=x1*(1-3*t.^2+2*t.^3)+x2*(3*t.^2-2*t.^3)+a1*(t-2*t.^2+t.^3)+a2*(t.^2+t.^3);
b1=m*cos(thetha1);
b2=m*cos(thetha2);
v2=y1*(1-3*t.^2+2*t.^3)+y2*(3*t.^2-2*t.^3)+b1*(t-2*t.^2+t.^3)+b2*(t.^2+t.^3);
plot(v1,v2)
end

COMMAND WINDOW
>> hermite
x-coordinate of 1st point1
x1 =
1
x-coordinate of 2nd point3
x2 =
3
y-coordinate of 1st point2
y1 =
2
y-coordinate of 2nd point1
y2 =
1
angle of first vector60
thetha1 =
60
angle of second vector30

thetha2 =
30
magnitude of vector1
m=
1
a1 =
-0.9524
a2 =
0.1543

CURVE

Anda mungkin juga menyukai