Documentation
¶
Index ¶
Constants ¶
const (
// Gravitational constant
G = 0.05
)
Simulation variables dt is set to 1
Variables ¶
var StarList []*Star
StarList is a global slice of stars
Functions ¶
func StartValues ¶
StartValues set starting position and velocity Forms a circle with start velocities approx tangential counterclockwise
func VelocityBarnesHut ¶
func VelocityBarnesHut()
VelocityBarnesHut updates position and velocity of all stars Velocity update is based on Barnes Hut approximation
func VelocityBarnesHutGR ¶
func VelocityBarnesHutGR()
VelocityBarnesHutGR updates position and velocity of all stars Velocity update is based on Barnes Hut approximation with go-routines
func VelocityExact ¶
func VelocityExact()
VelocityExact updates position and velocity of all stars Velocity update is based on exact calculation
func VelocityExactGR ¶
func VelocityExactGR()
VelocityExactGR updates position and velocity of all stars Velocity update is based on exact calculation with go routines
Types ¶
type Quad ¶
type Quad struct {
// contains filtered or unexported fields
}
Quad is a rectangle that contains four smaller rectangles Values are total mass, center of gravity and depth