function targetPoints(contour, endIndex) {
  const pt1 = tuple(contour[mod(endIndex-1, contour.length)]),
        pt2 = tuple(contour[endIndex]),
        pt5 = tuple(contour[mod(endIndex+3, contour.length)]),
        pt6 = tuple(contour[mod(endIndex+4, contour.length)]);
  const pt2Proj = projection(pt2, pt5, pt6),
        pt5Proj = projection(pt5, pt2, pt1);
  const tp20 = add(mul(0.5, pt5Proj), mul(0.5, pt2)),
        tp50 = add(mul(0.5, pt2Proj), mul(0.5, pt5));
  const r = 0;
  /** Target positions of pt2 and pt5 */
  const tp2 = add(mul(1-r, tp20), mul(r, tp50)),
        tp5 = add(mul(1-r, tp50), mul(r, tp20));
  /** Target positions of pt3 and pt4 */
  const tp3 = add(mul(0.3, tp2), mul(0.7, tp5)),
        tp4 = add(mul(0.7, tp2), mul(0.3, tp5));
  return [ tp2, tp3, tp4, tp5 ];
}
Target points of the stroke end
@param { Contour } contour 
@param { number } endIndex 
@returns { [ [number, number], [number, number], [number, number], 
[number, number] ] } new pt2, pt3, pt4 & pt5