]>
Book Contents Previous Section 21.1 images1.input Next Section 21.3 images3.input Book Index

## 21.2 images2.input

These images illustrate how Newton's method converges when computing the Newton iteration complex cube roots of 2. Each point in the (x,y)-plane represents the complex number x+iy, which is given as a starting point for Newton's method. The poles in these images represent bad starting values. The flat areas are the regions of convergence to the three roots.

)read newton Read the programs from
)read vectors Chapter 10
f := newtonStep(x**3 - 2) Create a Newton's iteration
function for x 3=2

The function f n computes n steps of Newton's method.

clipValue := 4 Clip values with magnitude > 4
drawComplexVectorField(f**3, -3..3, -3..3) The vector field for f 3
drawComplex(f**3, -3..3, -3..3) The surface for f 3
drawComplex(f**4, -3..3, -3..3) The surface for f 4
Book Contents Previous Section 21.1 images1.input Next Section 21.3 images3.input Book Index