image thumbnail
from 4RRR Parallel Manipulator by Hrishi Shah
This file is obsolete. newer version available in description.

[xy3]=serialplot(j_vars, base, lengths, i)
function [xy3]=serialplot(j_vars, base, lengths, i)
% d2r=3.1416/180;
th1=j_vars(1,1);
th2=j_vars(1,2);
th3=j_vars(1,3);
l1=lengths(1);
l2=lengths(2);
l3=lengths(3);
x(1)=base(1);
y(1)=base(2);
x(2)=x(1)+l1*cos(th1);
y(2)=y(1)+l1*sin(th1);
x(3)=x(2)+l2*cos(th1+th2);
y(3)=y(2)+l2*sin(th1+th2);
x(4)=x(3)+l3*cos(th3);
y(4)=y(3)+l3*sin(th3);
xy3=[x(3) y(3)];
if i==1
    plot(x,y,'color','r');
elseif i==2
    plot(x,y,'color','g');
elseif i==3
    plot(x,y,'color','b');
else
    plot(x,y,'color','k');
end
return

Contact us at files@mathworks.com