function [scaleZ1,teta1,scaleZ2,teta2]=DisplRadCirc_cicli(g1,displ13,g2,displ23)
for iii=1:20

scaleZ10=sqrt(g1.FEM.nodes(:,2,iii).^2+g1.FEM.nodes(:,3,iii).^2);
teta10=atan2(g1.FEM.nodes(:,3,iii),g1.FEM.nodes(:,2,iii));
y2=g2.FEM.nodes(:,3,iii)-g2.params.origin(2);
scaleZ20=sqrt(g2.FEM.nodes(:,2,iii).^2+y2.^2);
teta20=atan2(y2,g2.FEM.nodes(:,2,iii));

scaleZ11=sqrt((g1.FEM.nodes(:,2,iii)+displ13(:,1,iii)).^2+(g1.FEM.nodes(:,3,iii)+displ13(:,2,iii)).^2);
teta11=atan2((g1.FEM.nodes(:,3,iii)+displ13(:,2,iii)),(g1.FEM.nodes(:,2,iii)+displ13(:,1,iii)));
scaleZ1(:,iii)=sqrt(displ13(:,1,iii).^2+displ13(:,2,iii).^2);
% teta1=-acos((scaleZ10-scaleZ11.*cos(teta11-teta10))./scaleZ1)
teta1=teta11-teta10;
teta1(:,iii)=unwrap(teta1);

scaleZ21=sqrt((g2.FEM.nodes(:,2,iii)+displ23(:,1,iii)).^2+(y2+displ23(:,2,iii)).^2);
teta21=atan2((y2+displ23(:,2,iii)),(g2.FEM.nodes(:,2,iii)+displ23(:,1,iii)));
scaleZ2(:,iii)=sqrt(displ23(:,1,iii).^2+displ23(:,2,iii).^2);
% teta2=acos((scaleZ20-scaleZ21.*cos(teta21-teta20))./scaleZ2)
teta2=teta21-teta20;
teta2(:,iii)=unwrap(teta2);

% PlotDefoMesh_mod(g1.FEM.nodes(:,2:4,iii),g1.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ13(:,:,iii),teta1(:,iii),...
%     g1.FEM.surffaces,g1.FEM.elfa);
% title('Spostamenti circonferenziali pignone',num2str(iii))
% PlotDefoMesh_mod(g2.FEM.nodes(:,2:4,iii),g2.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ23(:,:,iii),teta2(:,iii),...
%     g2.FEM.surffaces,g2.FEM.elfa);
% title('Spostamenti circonferenziali ruota condotta')
% PlotDefoMesh_mod2(100,g1.FEM.nodes(:,2:4),g1.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ13(:,:,iii),teta1(:,iii),...
%     g1.FEM.surffaces,g1.FEM.elfa);
% title('Spostamenti circonferenziali accoppiamento')
% PlotDefoMesh_mod2(100,g2.FEM.nodes(:,2:4),g2.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ23(:,:,iii),teta2(:,iii),...
%     g2.FEM.surffaces,g2.FEM.elfa);
 
% PlotDefoMesh_mod(g1.FEM.nodes(:,2:4,iii),g1.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ13(:,:,iii),scaleZ1(:,iii),...
%     g1.FEM.surffaces,g1.FEM.elfa);
% c=colorbar;
% c.Label.String='[mm]';
% title('Spostamenti radiali pignone')
% PlotDefoMesh_mod(g2.FEM.nodes(:,2:4,iii),g2.FEM.elems(:,2:9),4/max(abs(scaleZ2(:,iii))),...
%     displ23(:,:,iii),scaleZ2(:,iii),...
%     g2.FEM.surffaces,g2.FEM.elfa)
% c=colorbar;
% c.Label.String='[rad]';
% title('Spostamenti radiali ruota condotta')
% PlotDefoMesh_mod2(102,g1.FEM.nodes(:,2:4,iii),g1.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ13(:,:,iii),scaleZ1(:,iii),...
%     g1.FEM.surffaces,g1.FEM.elfa)
% title('Spostamenti radiali accoppiamento')
% PlotDefoMesh_mod2(102,g2.FEM.nodes(:,2:4,iii),g2.FEM.elems(:,2:9),4/max(abs(scaleZ1(:,iii))),...
%     displ23(:,:,iii),scaleZ2(:,iii),...
%     g2.FEM.surffaces,g2.FEM.elfa)
end
end

