algo

package
v0.0.0-...-20db447 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 3 Imported by: 0

README

Lorenz

This package is given as an example of a simple algorithm for converting a set of input parameters into art. It is a simple implementation of the Lorenz System, which is a co-creation of Margaret Hamilton, Ellen Fetter and Edward Lorenz, first used in 1963 to model atmospheric convection.

The actual operation of this model is totally unimportant for the purposes of an artist who is hoping to create an algorithm on ABOUND. All that is needed to understand is that this package describes the inputs that it wants to take from the configuraiton JSON (the Config struct), and offers a method to convert the configuration into an image (the Run method). In this way it offers a template that you can copy and hollow out, replacing it with the logic that produces your art.

Documentation

Overview

Package algo implements a Lorenz attractor, see https://en.wikipedia.org/wiki/Lorenz_system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(c *Config) image.Image

Types

type Bounds

type Bounds struct {
	Min *Point
	Max *Point
}

func (*Bounds) Expand

func (b *Bounds) Expand(p *Point)

func (*Bounds) Translate

func (b *Bounds) Translate(p *Point, resultSize int) *Point

type Config

type Config struct {
	Beta       float64 `json:"beta"`
	Rho        float64 `json:"rho"`
	Sigma      float64 `json:"sigma"`
	DT         float64 `json:"dt"`
	Iterations int     `json:"iterations"`
	ResultSize int     `json:"result_size"`
}

func (*Config) NextStep

func (c *Config) NextStep(p *Point) *Point

type Point

type Point struct {
	X, Y, Z float64
}

Jump to

Keyboard shortcuts

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