voronoi

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	Points     []*Point
	ShowPoints bool
}

func MakeAnimation

func MakeAnimation(numPoints int, showPoints bool) (*Animation, error)

func (*Animation) Draw

func (a *Animation) Draw()

Draw draws the animation on screen and updates the dots

func (*Animation) Start

func (a *Animation) Start()

Start starts the animation

type Point

type Point struct {
	Y, X   float64           // Actual position
	DY, DX float64           // Movement Diff
	Color  termbox.Attribute // Color of the point
}

func (*Point) Distance

func (p *Point) Distance(y, x int) float64

Distance calculates the distance of (y,x) from the point

func (*Point) Update

func (p *Point) Update(h, w int)

Update updates the position of the point and wraps it around the width and height

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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