fractals

package
v0.0.0-...-4dd2d8e Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BurningShip

type BurningShip struct {
	Canvas        Canvas
	EscapeRadius  float32
	MaxIterations int
}

func (BurningShip) Render

func (fractal BurningShip) Render(items *FractalElements)

type Canvas

type Canvas struct {
	Size   Size
	Zoom   float32
	Center FloatPoint
}

type Element

type Element struct {
	X, Y  int
	Value float32
}

type FloatPoint

type FloatPoint struct {
	X, Y float32
}

type Fractal

type Fractal interface {
	Render(items *FractalElements)
}

func New

func New(fractalType string, width, height int) (Fractal, error)

type FractalElements

type FractalElements struct {
	Elements []Element
}

func NewFractalElements

func NewFractalElements() *FractalElements

func (*FractalElements) Add

func (f *FractalElements) Add(e Element)

type ImageFactory

type ImageFactory struct {
	Width, Height int
	Picker        cp.ColourPicker
	WithCenter    bool
}

func (ImageFactory) FromItems

func (f ImageFactory) FromItems(items *FractalElements) *image.RGBA

type JuliaSet

type JuliaSet struct {
	Canvas        Canvas
	Complex       complex64
	EscapeRadius  float32
	MaxIterations int
}

func (JuliaSet) Render

func (fractal JuliaSet) Render(items *FractalElements)

type MandelbrotSet

type MandelbrotSet struct {
	Canvas        Canvas
	EscapeRadius  float32
	MaxIterations int
}

func (MandelbrotSet) Render

func (fractal MandelbrotSet) Render(items *FractalElements)

type Size

type Size struct {
	Width, Height int
}

Jump to

Keyboard shortcuts

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