plot

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package plot implemants the Fractal Growth algorithm described in The Computational Beauty of Nature by Gary William Flake.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grammar

type Grammar struct {
	Seed  string
	Rules map[rune]string
}

func (*Grammar) Expand

func (g *Grammar) Expand(s string) string

func (*Grammar) Iterate

func (g *Grammar) Iterate(n int, complexityLimit int) (string, error)

type Plotter

type Plotter struct {
	InitialAngle   float64
	AngleDelta     float64
	Step           float64
	StepDelta      float64
	LineWidth      float64
	LineWidthDelta float64
}

func (*Plotter) Measure

func (p *Plotter) Measure(s string) (float64, float64, float64, float64)

func (*Plotter) Plot

func (p *Plotter) Plot(s string, gc draw2d.GraphicContext, x, y float64) error

type Turtle

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

func NewTurtle

func NewTurtle(gc draw2d.GraphicContext) *Turtle

func (*Turtle) Bounds

func (t *Turtle) Bounds() (float64, float64, float64, float64)

func (*Turtle) DrawForward

func (t *Turtle) DrawForward(d float64)

func (*Turtle) GoForward

func (t *Turtle) GoForward(d float64)

func (*Turtle) MoveTo

func (t *Turtle) MoveTo(x, y float64)

func (*Turtle) RestoreState

func (t *Turtle) RestoreState()

func (*Turtle) Rotate

func (t *Turtle) Rotate(a float64)

func (*Turtle) RotateTo

func (t *Turtle) RotateTo(h float64)

func (*Turtle) SaveState

func (t *Turtle) SaveState()

func (*Turtle) SetLineWidth

func (t *Turtle) SetLineWidth(w float64)

Jump to

Keyboard shortcuts

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