Documentation
¶
Overview ¶
Package buddha constructs a visual representation of the Buddhabrot.
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 {
// contains filtered or unexported fields
}
Image implements a visual representation of the Buddhabrot 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.