about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/main.go b/main.go
index 0ad2e69..7aa389f 100644
--- a/main.go
+++ b/main.go
@@ -7,37 +7,40 @@ import (
 	"./structs"
 	"fmt"
 	"git.darknebu.la/bit/logplus"
+	"math"
 )
 
 func main() {
+	logplus.SetLogLevel(logplus.LevelAll)
 	var threads int = 8
+	var path1 string = "out_0.png"
 	var frames int = 1
-	var stars int = 800
 
 	// the slice starsSlice stores the star structures
-	starsSlice := []structs.Star2D{}
+	starsSlice := []structs.Star2D{
+		//		{C: structs.Vec2{X:  30000,  Y: 30000},M: 5E8},
+		//		{C: structs.Vec2{X: -30000,  Y: 30000},M: 5E8},
+		//		{C: structs.Vec2{X: -30000           },M: 5E8},
+		//		{C: structs.Vec2{X:  30000, Y: -30000},M: 5E8},
+		{C: structs.Vec2{}, M: 5E8},
+	}
 
-	logplus.LogPositive("Opening the csv")
-	starsSlice = csv.Import("data/U_ALL.csv", 0, stars, starsSlice)
+	logplus.LogNeutral("Opening the csv")
+	starsSlice = csv.Import("data/U_ALL.csv", 0, 25000, starsSlice)
 
 	// Simulate the position of the stars after a specific time
 	for i := 0; i < frames; i++ {
-
-		// Print the iterator
 		logplus.LogPositive("--- --- --- --- ---")
 		logplus.LogPositive(fmt.Sprintf("Frames %d/%d", i, frames))
 
-		// Calculate the position of stars after one timestep
-		logplus.LogPositive("Calculate the new Star positions")
-		starsSlice = forces.NextTimestep(starsSlice, 500000)
+		logplus.LogNeutral("Calculate the new Star positions")
+		starsSlice = forces.NextTimestep(starsSlice, 25*math.Pow(10, 4+7))
 
-		// Calculate all the forces acting inside of the galaxy
-		logplus.LogPositive("Calculate the acting forces")
-		starsSlice = forces.CalcAllForces(starsSlice, threads)
+		logplus.LogNeutral("Calculate the acting accelerations")
+		starsSlice = forces.CalcAllAccelerations(starsSlice, threads)
 
-		// Save the slice
 		outputName := fmt.Sprintf("out_%d.png", i+1)
-		logplus.LogPositive(fmt.Sprintf("draw the slice and save it to %s\n", outputName))
+		logplus.LogNeutral(fmt.Sprintf("draw the slice and save it to %s\n", outputName))
 		draw.Slice(starsSlice, outputName)
 	}
 }