about summary refs log tree commit diff
path: root/draw/draw.go
diff options
context:
space:
mode:
authoremile <hanemile@protonmail.com>2018-10-19 17:49:44 +0200
committeremile <hanemile@protonmail.com>2018-10-19 17:49:44 +0200
commita759b1c59e63f5515a03183fba79d36491b2d717 (patch)
tree22c2c9c8379d8f2a511b67eb729dd2aa65564510 /draw/draw.go
parentd468ff69c1b83ae41e03c92045c03fed35201833 (diff)
Adjusted the method for defining how big a star should be drawn.
Diffstat (limited to 'draw/draw.go')
-rw-r--r--draw/draw.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/draw/draw.go b/draw/draw.go
index d1166b4..06d76e2 100644
--- a/draw/draw.go
+++ b/draw/draw.go
@@ -36,14 +36,14 @@ func saveImage(dc *gg.Context, path string) {
 // drawStar draws the given stars to the given context
 func drawStar(dc *gg.Context, star structs.Star2D) {
 	// User the value below to controll how big the stars are overall
-	var StarScalingFactor float64 = 1
+	var starScalingFactor = 50.0
 
 	// Default Star Size
 	S := 2.0
 
 	// Calculate the Stars Size according to its Mass (Maximal size = 5)
 	if star.M < 5e4 {
-		S = float64(math.Ceil(star.M/4e4) * StarScalingFactor)
+		S = float64(math.Ceil(math.Sqrt(star.M)) / starScalingFactor)
 	} else {
 		S = 5.0
 	}
@@ -111,12 +111,6 @@ func Slice(slice []structs.Star2D, path string) {
 
 	dc.SetRGB(1, 1, 1)
 
-	// drawing the 4 big stars as bigger white dots
-	//dc.DrawCircle(600, 600, 5)
-	//dc.DrawCircle(-600, 600, 5)
-	//dc.DrawCircle(-600, 0, 5)
-	//dc.DrawCircle(600, -600, 5)
-
 	dc.Fill()
 
 	// save the plot to the given path