mandelbrot: Mandelbrot set

Description Usage Arguments Value See Also Examples

View source: R/mandelbrot.R

Description

Generate the mandelbrot set.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mandelbrot(
  width,
  height,
  re_width = 3.5,
  im_height = NA,
  center = complex(real = -0.5, imaginary = 0),
  max_iterations = 128,
  threshold = 2,
  return_colors = TRUE,
  color_palette = NULL,
  color_inside = "black",
  color_mode = c("simple", "histogram", "smooth")
)

Arguments

width, height

The width and height in pixels.

re_width, im_height

The width and height of the complex plane

center

A complex number giving the center of the complex plane. Defaults to -0.5+0i.

max_iterations

The maximum number of iterations. Defaults is 128

threshold

The threshold value. Default is 2.

return_colors

Logical. Should the colors or the number of steps be returned?

color_palette

A vector of colors. Should be the same length as max_iterations.

color_inside

The color of the area inside the set.

color_mode

How the colors of the set will be calculated. One of "simple", "histogram" or "smooth". Can be abbreviated.

Value

A matrix of class "color_matrix" specifying the color for each pixel.

See Also

plot.color_matrix()

Examples

1
2
m <- mandelbrot(width = 200, height = 150)
plot(m)

BastiHz/fractalplotr documentation built on Sept. 9, 2021, 4:46 a.m.