image thumbnail
from 4RRR Kinematics with GUI and Mouse Support by Hrishi Shah
Fully Generalized 4RRR Kinematics with GUI

[xy3]=serialplot(j_vars, base, lengths, i, serplot)
function [xy3]=serialplot(j_vars, base, lengths, i, serplot)
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)];
set(serplot(i),'Xdata',x,'Ydata',y);
return

Contact us at files@mathworks.com