Documentation ¶
Overview ¶
Package parameters defines parameters used to plot Buddhabrot images.
Package parameters defines parameters used to plot Buddhabrot images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateStops ¶
func ValidateStops(fl validator.FieldLevel) bool
ValidateStops validates that the state of a slice of Stops.
Types ¶
type Plot ¶
type Plot struct { SampleSize, MaxIterations int `validate:"gte=1"` Region Region Width, Height int `validate:"gte=1"` Gradient []Stop `validate:"validateStops"` DumpCounterFile bool }
Plot represents the parameters to plot a Buddhabrot image of a given width and height. SampleSize determines the number of sample points used. MaxIterations is the maximum number of iterations to determine if a sample point is in the Mandelbrot set. It is also the maximum number of iterations to count orbits that pass through points visible in the plot. Region defines the region on the complex plane to plot. Gradient is a slice of colors and their positions in a linear gradient used to color the image. If set to true, the `dumpCounterFile` property wil dump the orbit counts per pixel to a file called counter.txt in the log directory.
type Region ¶
type Region struct { MinReal, MaxReal, MinImag, MaxImag float64 }
Region is a region on the complex plane defined by minimum and maximum real and imaginary parts.
func (*Region) MatchAspectRatio ¶
MatchAspectRatio adjusts the imaginary range of the region to match the aspect ratio of the image being plotted.
func (Region) PointInRegion ¶
func (r Region) PointInRegion(c complex128) bool
PointInRegion returns true if a given complex number is within the region.