though code seems to be correct there is some problem coupler is getting stretched in half rotation
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
axis(gca ,'equal');%aspect ratio
axis([-30 30 -30 30]);%axis limits
w=15;
a=[0 0];
d=[12 0];
r1=12;
r2=6;
r3=15;
r4=13;
for t=0:600
theta=(w*t*2*3.14)/60;
b=r2*[cosd(theta) sind(theta)];
crank=line([a(1) b(1)],[a(2) b(2)],'color','r','linewidth',5);
k=sqrt((b(1)-d(1))^2+(b(2)-d(2))^2);
alpha=acosd((k*k+r1*r1-r2*r2)/(2*k*r1));
beta=acosd((k*k+r4*r4-r3*r3)/(2*k*r4));
disp(acosd((k*k+r4*r4-r3*r3)/(2*k*r4)));
phi=180-(alpha+beta);
c=[r1+r4*cosd(phi) r4*sind(phi)];
output=line([d(1) c(1)],[d(2) c(2)],'color','g','linewidth',5);
coupler=line([c(1) b(1)],[c(2) b(2)] ,'color','k','linewidth',5);
pt_a=viscircles(a,0.1);
pt_b=viscircles(b,0.1);
pt_c=viscircles(c,0.1);
pt_d=viscircles(d,0.1);
traj1=viscircles(a,r2);
traj2=viscircles(c,0.1);
pause(0.001);
delete(crank);
delete(output);
delete(coupler);
delete(traj1);
delete(pt_b);
delete(pt_c);
delete(pt_d);
end
4 comentarios
darova
el 12 de Mayo de 2020
Can you show α and β angles?

sonali utage
el 13 de Mayo de 2020
sonali utage
el 13 de Mayo de 2020
darova
el 13 de Mayo de 2020

Respuestas (1)
darova
el 13 de Mayo de 2020
0 votos
Try this solution
- find angle

- rotate
by
angle

La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
