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

 %-- Pe/Feet ----------------------------------------------
  x0 = 0;
  y0 = 0;
 %-- Tornozelo/Ankle ----------------------------------------------
  x1 = l0*cos(ang0);
  y1 = l0*sin(ang0);

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