m = 20;
pts2[pts_,
n_] := {(Complex @@@ pts)[[1 ;; n]], (Complex @@@ pts)[[-n ;; -1]]};
CompList[lz_] := Transpose@{Re[#], Im[#]} &@lz;
DKA[root_, lz0_] := (
Clear[f, rec, lz];
lz[0] = lz0;
f[z_] = Times @@ (z - #) &@root;
rec[lz_, n_] :=
lz[[n]] - f[lz[[n]]]/Times @@ Delete[lz[[n]] - lz, n];
lz[i_] := lz[i] = Table[rec[lz[i - 1], n], {n, Length[lz0]}];
p = CompList /@ lz /@ Range[0, m];
Graphics[{Point[Flatten[p, 1]], Line[Transpose[p]],
PointSize[0.02], Blue, Point[CompList@lz0], Red,
Point[CompList@root]}, PlotRange -> 3]);
Abeath[pts_, n_] :=
Table[Mean /@ Transpose[pts] +
2 {Cos[2 \[Pi] i/n], Sin[2 \[Pi] i/n]}, {i, n}];
Manipulate[pts = PadRight[pts, 2 n, RandomReal[{-1, 1}, {2 n, 2}]];
DKA @@ pts2[pts, n], {n, 1, 10, 1}, {{pts, {{0, 0}}}, Locator,
Appearance -> None},
Button[“Aberth”,
pts = Join[pts[[1 ;; n]], Abeath[pts[[1 ;; n]], n]]]]