function P = CinDir3R(ang1,ang2,ang3,l1,l2,l3)

 %-- Tornozelo/Ankle ----------------------------------------------
  x0=0;
  y0=0;

 %-- Joelho/Knee --------------------------------------------------
  x1=l1*cos(ang1);
  y1=l1*sin(ang1);
 
 %-- Anca/Hip -----------------------------------------------------
  x2=l1*cos(ang1)+l2*cos(ang1+ang2);
  y2=l1*sin(ang1)+l2*sin(ang1+ang2);
 %-----------------------------------------------------------------
 
 %-- Anca/Hip -----------------------------------------------------
  x3=l1*cos(ang1)+l2*cos(ang1+ang2)+l3*cos(ang1+ang2+ang3);
  y3=l1*sin(ang1)+l2*sin(ang1+ang2)+l3*sin(ang1+ang2+ang3);
 %-----------------------------------------------------------------
  P = [x0;y0; x1;y1; x2;y2; x3;y3];
 %--------------------------------------------------------------end
