Assignment 6
Assignment 6
Name
: Nuthan venkata sai gandikota
ID : 2021A4PS3065H
x_start = 1; y_start = 1;
x_end = 2; y_end = 2;
t = 0:0.01:1;
x1 = x_start + 10*(t(1:10)).^3;
y1 = y_start + 10*(t(1:10)).^3;
x2 = x1(end) + 0.9*(t(11:90)-0.1);
y2 = y1(end) + 0.9*(t(11:90)-0.1);
x3 = x2(end) + 10*(1-t(91:end)).^3;
y3 = y2(end) + 10*(1-t(91:end)).^3;
% Combine segments
x = [x1 x2 x3];
y = [y1 y2 y3];
sin(theta2)/(l1+l2*cos(theta2)), 1/(l1+l2*cos(theta2))];
dx = x(2:end) - x(1:end-1);
dy = y(2:end) - y(1:end-1);
dtheta_array(1,:) = dtheta(1,:);
dtheta_array(2,:) = dtheta(2,:);
figure;
l1 = 1; l2 = 1;
x1 = l1*cos(theta1);
y1 = l1*sin(theta1);
x2 = x1 + l2*cos(theta1+theta2);
y2 = y1 + l2*sin(theta1+theta2);
pause(1);
for i = 1:size(dtheta_array,2)
x1 = l1*cos(theta1);
y1 = l1*sin(theta1);
x2 = x1 + l2*cos(theta1+theta2);
y2 = y1 + l2*sin(theta1+theta2);
cla;
axis equal;
pause(0.01);
end