Documentation
¶
Index ¶
Constants ¶
View Source
const G float64 = 6.674e-11
Variables ¶
View Source
var EarthMoon = [...]Body{ { Mass: 5.972e24, Position: r2.Vec{X: 0, Y: 0}, Velocity: r2.Vec{X: 0, Y: 0}, }, { Mass: 7.347e22, Position: r2.Vec{X: 384.4e6, Y: 0}, Velocity: r2.Vec{X: 0, Y: -1022.0}, }, { Mass: 1, Position: r2.Vec{X: 1.922e8, Y: 3.329e8}, Velocity: r2.Vec{X: 1022.0 * math.Cos(30.0*math.Pi/180) * 0.98, Y: -1022.0 * math.Sin(30*math.Pi/180)}, }, }
View Source
var FourBodySystem = [...]Body{ { Mass: 1e12, Position: r2.Vec{X: 0, Y: 0}, Velocity: r2.Vec{X: 0, Y: 0}, }, { Mass: 1e11, Position: r2.Vec{X: 0, Y: 15}, Velocity: r2.Vec{X: 2.3, Y: 0}, }, { Mass: 1e10, Position: r2.Vec{X: 0, Y: 13.5}, Velocity: r2.Vec{X: 0, Y: 0}, }, { Mass: 1e9, Position: r2.Vec{X: 0, Y: 4}, Velocity: r2.Vec{X: 4, Y: 0}, }, }
View Source
var GravitySlingshot = [...]Body{ { Mass: 1e13, Position: r2.Vec{X: 0, Y: 0}, Velocity: r2.Vec{X: 0, Y: 0}, }, { Mass: 1e12, Position: r2.Vec{X: 15, Y: 0}, Velocity: r2.Vec{X: 0, Y: -7}, }, { Mass: 1e11, Position: r2.Vec{X: -15, Y: 0}, Velocity: r2.Vec{X: 0, Y: 5}, }, }
View Source
var LagrangeL4L5 = [...]Body{ { Mass: 1e12, Position: r2.Vec{X: 0, Y: 0}, Velocity: r2.Vec{X: 0, Y: 0}, }, { Mass: 1e10, Position: r2.Vec{X: 20, Y: 0}, Velocity: r2.Vec{X: 0, Y: -1.836}, }, { Mass: 1, Position: r2.Vec{X: 10, Y: 17.32}, Velocity: r2.Vec{X: 0.965 * 1.836 * math.Cos(30.0*math.Pi/180), Y: -1.836 * math.Sin(30*math.Pi/180)}, }, }
Functions ¶
This section is empty.
Types ¶
type Simulation ¶
func NewSimulation ¶
func NewSimulation(timeStep float64) *Simulation
func (*Simulation) CalculateAccelerationAt ¶
func (sim *Simulation) CalculateAccelerationAt(pos r2.Vec) r2.Vec
func (*Simulation) CalculateCenterOfMass ¶
func (sim *Simulation) CalculateCenterOfMass() r2.Vec
func (*Simulation) CalculateTotalEnergy ¶
func (sim *Simulation) CalculateTotalEnergy() float64
func (*Simulation) Step ¶
func (sim *Simulation) Step()
Click to show internal directories.
Click to hide internal directories.