Function mandel(xi As Double, yi As Double) maxiter = 256 x = 0 y = 0 For i = 1 To maxiter If ((x * x) + (y * y)) > 4 Then Exit For xt = xi + ((x * x) - (y * y)) y = yi + (2 * x * y) x = xt Next mandel = i End Function