srw

package module
v0.0.0-...-d8704fb Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 4 Imported by: 0

README

Self-replicating words (and Rauzy fractals)

This is a Go implementation of the self-replicating words and Rauzy fractals. Details on mathematical settings can be found here.

How to use

Self-replicating words
package main

import "github.com/hyosangkang/srw"

furn main() {
	f := srw.NewFractal(6, []int{0, 1, 0, 2})
	f.Save("test.png")
}

NewFractal(n, seq) takes two arguments. n is the number of layers (int) and seq is the sequence of letters ([]int) in the initial word. Note that large n may take a long time to compute. We hightly advise to use n start from 2 and increase it gradually. To visualize the fractal, use Save(fn) where fn is the file name (string) to save the image.

Rauzy fractal
package main

import "github.com/hyosangkang/srw"

furn main() {
	f := srw.NewFractal(6, []int{})
	f.SetRauzy() 
    f.SetBdd() // to show the boundary only
	f.Save("test.png")
}

SetRauzy() forces the fractal to be the Rauzy fractal. With SetBdd(), only the boundary points in the Rauzy fractal are shown in the image.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFractal

func NewFractal(n int, seq []int) *fractal

Types

This section is empty.

Jump to

Keyboard shortcuts

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