system

package
v0.0.0-...-b405a3c Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SCALE = 1e-12
View Source
var T = 1.0

Time interval = 1 year

Functions

func Force

func Force(p1, p2 *Particle) (float64, float64)

func GetMassFromConfig

func GetMassFromConfig(mass string) float64

Types

type Config

type Config struct {
	Particles  []ConfigParticle `json:"particles"`
	Video      OutputVideo      `json:"video"`
	Iterations int              `json:"iterations"`
}

type ConfigParticle

type ConfigParticle struct {
	X       float64 `json:"x"`
	Y       float64 `json:"y"`
	Vx      float64 `json:"vx"`
	Vy      float64 `json:"vy"`
	Color   []uint8
	Key     string
	Context []string
	Mass    string
}

type Modifier

type Modifier struct {
	AddX  float64
	AddY  float64
	AddVX float64
	AddVY float64
}

type OutputVideo

type OutputVideo struct {
	Size     VideoSize `json:"size"`
	FPS      int       `json:"fps"`
	Filename string    `json:"filename"`
}

type Particle

type Particle struct {
	X       float64 `json:"x"`
	Y       float64 `json:"y"`
	Vx      float64 `json:"vx"`
	Vy      float64 `json:"vy"`
	Color   color.Color
	Key     string
	Context []string
	Mass    float64
}

func GetParticleFromConfig

func GetParticleFromConfig(p *ConfigParticle) Particle

type System

type System struct {
	Particles map[string]*Particle
}

func New

func New() *System

func (*System) AddParticle

func (s *System) AddParticle(p *Particle)

func (*System) Build

func (s *System) Build()

func (*System) Describe

func (s *System) Describe()

func (*System) Next

func (s *System) Next()

type SystemInterface

type SystemInterface interface {
	AddParticle(p *Particle)
}

type VideoSize

type VideoSize struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Jump to

Keyboard shortcuts

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