From 6e137fe268d9933bfafa5b064fbfaf8e4e682275 Mon Sep 17 00:00:00 2001 From: emile Date: Sat, 13 Oct 2018 22:30:54 +0200 Subject: Importing the z value of the precalculated star-positions and using it. --- csv/csv.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'csv') diff --git a/csv/csv.go b/csv/csv.go index 6f1b652..dc4cdf1 100644 --- a/csv/csv.go +++ b/csv/csv.go @@ -43,19 +43,23 @@ func Import(path string, start int, end int, slice []structs.Star) []structs.Sta for linenr, line := range lines[start:end] { x, errx := strconv.ParseFloat(line[0], 64) y, erry := strconv.ParseFloat(line[1], 64) + z, errz := strconv.ParseFloat(line[2], 64) // Handle errors if errx != nil { log.Printf("error reading value from csv in line nr. %d (%s)", linenr, errx) } - if errx != nil { + if erry != nil { log.Printf("error reading value from csv in line nr. %d (%s)", linenr, erry) } + if errz != nil { + log.Printf("error reading value from csv in line nr. %d (%s)", linenr, errz) + } // Create a temporary star for assembling the star tempStar := structs.Star{ - structs.Coord{x, y}, - structs.Force{0, 0}, + structs.Coord{X: x, Y: y, Z: z}, + structs.Force{X: 0, Y: 0, Z: 0}, 50000, } -- cgit 1.4.1