fractal

package module
v0.0.0-...-9fe5cf2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2019 License: LGPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x *BigComplex) *big.Float

sqrt(x.real^2 + x.Imag^2)

func Draw_Image

func Draw_Image(filename string, plot_map map[Key]Point, width int, height int, gradient string, maxIterations int, colour_mode string)

func EscapeTimeCalculator

func EscapeTimeCalculator(base Base, midX float64, midY float64, zoom float64, width int, height int, calculator EscapeCalculator) map[Key]Point

Types

type Base

type Base struct {
	RMin, RMax, IMin, IMax float64
}

Base defines the bounds and starting zoom of the fractal

type BigComplex

type BigComplex struct {
	// contains filtered or unexported fields
}

BigComplex

func (*BigComplex) Add

func (z *BigComplex) Add(x, y *BigComplex) *BigComplex

func (*BigComplex) Mul

func (z *BigComplex) Mul(x, y *BigComplex) *BigComplex

Multiplying two complex numbers looks like a quadratic equation * * (x + yi)(w + zi) == w * w + xzi + wyi + yzi^2 * And since i^2 = -1, this becomes ww-yz + (xz+wy)i

func (*BigComplex) Quo

func (z *BigComplex) Quo(x, y *BigComplex) *BigComplex

x + yi / u + vi = (xu + yv) + (-xv + yu)i / u^2 + v^2

func (*BigComplex) Sub

func (z *BigComplex) Sub(x, y *BigComplex) *BigComplex

type EscapeCalculator

type EscapeCalculator func(z complex128) (int, complex128, bool)

type Key

type Key struct {
	X, Y int
}

type Point

type Point struct {
	C       complex128
	X       int
	Y       int
	Escape  int
	FinalZ  complex128
	Escaped bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL