mikebharris / barnsley

The Barnsley Fern: an iterated function system fractal that brings nature to your screen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An implementation of the Barnsley Fern fractal algorithm in Go

Check out https://en.wikipedia.org/wiki/Barnsley_fern for details.

Run it with:

$ go run main.go > mynewfractal.png

Or use it in your own Go program, say to produce a gif, with:

package main

import (
	"github.com/mikebharris/barnsley/fern"
	"image/gif"
	"os"
)

func main() {
	gif.Encode(os.Stdout, fern.GenerateBarnsleyFern(240, 320, 100000), nil)
}

About

The Barnsley Fern: an iterated function system fractal that brings nature to your screen


Languages

Language:JavaScript 79.0%Language:Go 19.2%Language:HTML 1.7%