field

package
v0.0.0-...-8d962dd Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Seed int64
	// contains filtered or unexported fields
}

Field where each point is a vector with values X,Y that is generated by noise function

func GenerateField

func GenerateField(seed int64) *Field

GenerateField generates new field object and 2D noise based on given seed variable

func GenerateFieldFreq

func GenerateFieldFreq(seed int64, freq float64) *Field

GenerateFieldFreq Generates new field object and 2D noise based on given seed and specified frequency variable

func (*Field) Get

func (f *Field) Get(x, y int) (Vector, float64)

Get returns vector for given point and maximal length of it

type Vector

type Vector struct {
	X float64
	Y float64
}

Vector type that stores X,Y coordinates of the geometrical vector

Jump to

Keyboard shortcuts

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