1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package main
import (
"./csv"
"./draw"
"./forces"
"./llog"
"./structs"
"fmt"
)
func main() {
var threads int = 8
// the slice starsSlice stores the star structures
starsSlice := []structs.Star{
{structs.Coord{X: 30000, Y: 30000}, structs.Force{0, 0}, 500000000},
{structs.Coord{X: -30000, Y: 30000}, structs.Force{0, 0}, 500000000},
{structs.Coord{X: -30000, Y: 0}, structs.Force{0, 0}, 500000000},
{structs.Coord{X: 30000, Y: -30000}, structs.Force{0, 0}, 500000000},
}
llog.Good("Opening the csv\n")
starsSlice = csv.Import("data/U_ALL.csv", 0, 50000, starsSlice)
llog.Good("Calculate the acting forces\n")
starsSlice = forces.CalcAllForces(starsSlice, threads)
path := "out_2.png"
llog.Good(fmt.Sprintf("draw the slice and save it to %s\n", path))
draw.Slice(starsSlice, path)
}
|