algos

package
v0.0.0-...-3c012e0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package algos groups functions used for calculating fractals

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acos

func Acos(r, i float64) (blue, red uint8)

Acos calculates pixel values for arcus-cosinus fractal.

func MandelbrotC128

func MandelbrotC128(r, i float64) (blue, red uint8)

MandelbrotC128 calculates pixel values for Mandelbrot fractal using complex128 type.

func MandelbrotC64

func MandelbrotC64(r, i float64) (blue, red uint8)

MandelbrotC64 calculates pixel values for Mandelbrot fractal using complex64 type(at least tries to :) ).

func Newton

func Newton(r, i float64) (uint8, uint8)

Newton calculates pixel values for Newton's method of finding minimas.

f(x) = x^4 - 1

z' = z - f(z)/f'(z)

= z - (z^4 - 1) / (4 * z^3)
= z - (z - 1/z^3) / 4

func Sqrt

func Sqrt(r, i float64) (blue, red uint8)

Sqrt calculates pixel values for sqrt fractal.

Types

type AlgoFunc

type AlgoFunc func(r, i float64) (blue, red uint8)

AlgoFunc is the signature of the fuctions used for generating fractals

func MapStr2Func

func MapStr2Func(algo string) (AlgoFunc, error)

MapStr2Func converts string name of the fractal generator into a reference of the function implementing it.

Jump to

Keyboard shortcuts

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