Documentation ¶
Overview ¶
Package mset constructs visual representations of the Mandelbrot set.
The Mandelbrot set is the visual representation of an iterated function on the complex plane.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Colors = []color.Color{
red,
green,
blue,
yellow,
}
Colors represent the slice of colors that are used to represent how many iterations it took to escape the circle.
Thus pixels that escape on the first iteration are colored red, while pixels that escape on the second iteration are colored green.
var Grid = geometry.Rect(-2, -1.2, 1, 1.2)
Grid is the bounds of the coordinate system on which the Mandelbrot set will be displayed. The x and y values of grid doesn't represent pixels but rather positions on the coordinate system.
var Iterations = 100
Iterations represent the number of iterations that are required before a pixel is painted black.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { // When White is true, color all pixels white that are outside of the circle // before the first iteration. White bool // contains filtered or unexported fields }
Image implements a visual representation of the Mandelbrot set.
func (*Image) At ¶
At returns the color of the pixel at (x, y).
The color of each pixel is based on the number of iterations it took to escape the circle. Pixels that are already outside of the circle will be colored white, if img.White is set to true. Pixels that doesn't escape the circle after the max number of iterations will be colored black.
func (*Image) Bounds ¶
Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0).
func (*Image) ColorModel ¶
ColorModel returns the Image's color model.