# Attractor
The attractor \(w\) of a point \(c\) within a hyperbolic component of period \(p\) consists of \(p\) points, each satisfying:
\[F^p(w,c) = w\]
Applying Newton’s method in one complex variable:
\[ w_{m+1} = w_m - \frac{F^p(w_m, c) - w_m} {\frac{\partial}{\partial z}F^p(w_m, c) - 1}\]
A reasonable starting guess for Newton’s method is \(w_0 = F^p(0, c)\).
# 1 C99 Code
#include <complex.h>
double _Complex m_attractor
(double _Complex w0, double _Complex c, int p, int n)
{
double _Complex w = w0;
for (int m = 0; m < n; ++m)
{
double _Complex z = w;
double _Complex dz = 1;
for (int i = 0; i < p; ++i)
{
dz = 2 * z * dz;
z = z * z + c;
}
w = w - (z - w) / (dz - 1);
}
return w;
}
# 2 Examples
\(c = 0.5 i\), \(p = 1\): \[\begin{aligned} w_0 &= & 0.5 i \\ w_1 &= -0.1(2500000000000000\ldots) &+ 0.3(7500000000000000\ldots) i \\ w_2 &= -0.1360(2941176470587\ldots) &+ 0.393(38235294117646\ldots) i \\ w_3 &= -0.136009(77572623132\ldots) &+ 0.393075(72864807383\ldots) i \\ w_4 &= -0.13600982475703(358\ldots) &+ 0.3930756888787(0914\ldots) i \\ w_5 &= -0.13600982475703449(\ldots) &+ 0.39307568887871164(\ldots) i \end{aligned}\]
\(c = -1.1 + 0.1 i\), \(p = 2\): \[\begin{aligned} w_0 &= 0.1 &- 0.12 i \\ w_1 &= 0.09(5782435714904968\ldots) &- 0.08(4585559740811250\ldots) i \\ w_2 &= 0.09749(9098252211647\ldots) &- 0.0836(77122424611575\ldots) i \\ w_3 &= 0.097497068(763801931\ldots) &- 0.0836824188(71189990\ldots) i \\ w_4 &= 0.097497068806210202(\ldots) &- 0.083682418894370822(\ldots) i \end{aligned}\]