Documentation
¶
Index ¶
- func GenerateDragon(level int, instructions chan<- turtle.Instruction, forward float64)
- func GenerateHilbert(level int, instructions chan<- turtle.Instruction, forward float64)
- func GenerateSierpinskiArrowhead(level int, instructions chan<- turtle.Instruction, forward float64)
- func GenerateSierpinskiTriangle(level int, instructions chan<- turtle.Instruction, forward float64)
- func Instructions(level int, instructions chan<- turtle.Instruction, remaining string, ...) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDragon ¶
Generate instructions to draw a dragon curve.
https://en.wikipedia.org/wiki/Dragon_curve https://en.wikipedia.org/wiki/L-system#Example_6:_Dragon_curve
func GenerateHilbert ¶
Generate instructions to draw a Hilbert curve, with the requested recursion level, receiving Instruction on the channel instructions.
The channel will be closed to signal the end of the stream.
For more information: https://en.wikipedia.org/wiki/Hilbert_curve#Representation_as_Lindenmayer_system
func GenerateSierpinskiArrowhead ¶
func GenerateSierpinskiArrowhead(level int, instructions chan<- turtle.Instruction, forward float64)
Generate instructions to draw a Sierpinski arrowhead curve.
https://en.wikipedia.org/wiki/Sierpi%C5%84ski_curve#Arrowhead_curve
func GenerateSierpinskiTriangle ¶
Generate instructions to draw a Sierpinski triangle.
https://en.wikipedia.org/wiki/L-system#Example_5:_Sierpinski_triangle
func Instructions ¶
func Instructions( level int, instructions chan<- turtle.Instruction, remaining string, rules map[byte]string, angle float64, forward float64, ) string
Generate instructions for a general Lindenmayer system.
level: recursion level to reach. instructions: channel where the instructions will be sent. remaining: set to the axiom. rules: production rules. angle: how much to rotate. forward: how much to move forward.
Two mildly different rewrite rules can be used: using ABCD, the forward movement must be explicit, using an F. using XYWZ, the forward movement is done when the base of the recursion is reached.
Types ¶
This section is empty.