View source: R/demo_api-mandelbrot.R
| mandelbrot | R Documentation |
Mandelbrot convergence counts
mandelbrot(...)
## S3 method for class 'matrix'
mandelbrot(Z, maxIter = 200L, tau = 2, ...)
## S3 method for class 'numeric'
mandelbrot(
xmid = -0.75,
ymid = 0,
side = 3,
resolution = 400L,
maxIter = 200L,
tau = 2,
...
)
Z |
A complex matrix ( |
maxIter |
Maximum number of iterations ( |
tau |
A threshold ( |
xmid, ymid, side, resolution |
Alternative specification of
the complex plane |
Returns an integer matrix (of class Mandelbrot) with
non-negative counts (C).
The convergence counts are calculated using the standard escape-time
algorithm for the Mandelbrot set: for each complex number c, the
sequence z_{i+1} \leftarrow z_{i}^2 + c (starting at z_{0} = c)
is iterated until either its modulus (|z_{i}|) exceeds the escape
radius \tau (tau) or the maximum number of iterations (c^{max})
has been reached. The count (c_{i}) recorded is the iteration at which
the sequence escaped, or c^{max} for points that never escaped.
Mandelbrot set, https://en.wikipedia.org/wiki/Mandelbrot_set, 2026
counts <- mandelbrot(xmid = -0.75, ymid = 0, side = 3)
str(counts)
## Not run:
plot(counts)
## End(Not run)
## Not run:
demo("mandelbrot", package = "future", ask = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.