function R = CinDir2R(ang1,ang2,l1,l2)

global l1 l2

 %-- Elo 1 --------------------------------------------------------
  x1=l1*cos(ang1);
  y1=l1*sin(ang1);
 
 %-- Elo 2 --------------------------------------------------------
  x2=l1*cos(ang1)+l2*cos(ang1+ang2);
  y2=l1*sin(ang1)+l2*sin(ang1+ang2);
 %-----------------------------------------------------------------
 
  R = [x1; y1; x2; y2];
 %--------------------------------------------------------------end
