about summary refs log tree commit diff
path: root/src/go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go')
-rw-r--r--src/go/coords.go18
-rw-r--r--src/go/data/100.csv5
-rwxr-xr-xsrc/go/gobin0 -> 2025101 bytes
-rwxr-xr-xsrc/go/lookupbin0 -> 2025566 bytes
-rw-r--r--src/go/lookup.go54
5 files changed, 77 insertions, 0 deletions
diff --git a/src/go/coords.go b/src/go/coords.go
new file mode 100644
index 0000000..819f36f
--- /dev/null
+++ b/src/go/coords.go
@@ -0,0 +1,18 @@
+// Generate Star coordinates using a custom function
+
+// arg1 = number of stars
+// arg2 = save path
+
+package main
+
+import (
+  "fmt"
+  "os"
+)
+
+func main(){
+
+  arguments := os.Args[1:]
+
+  fmt.Println(arguments)
+}
diff --git a/src/go/data/100.csv b/src/go/data/100.csv
new file mode 100644
index 0000000..eea675d
--- /dev/null
+++ b/src/go/data/100.csv
@@ -0,0 +1,5 @@
+This is test content
+If this is displayed, the software is working!
+\o/
+ |
+/ \
diff --git a/src/go/go b/src/go/go
new file mode 100755
index 0000000..43dbd99
--- /dev/null
+++ b/src/go/go
Binary files differdiff --git a/src/go/lookup b/src/go/lookup
new file mode 100755
index 0000000..03c8927
--- /dev/null
+++ b/src/go/lookup
Binary files differdiff --git a/src/go/lookup.go b/src/go/lookup.go
new file mode 100644
index 0000000..c222de5
--- /dev/null
+++ b/src/go/lookup.go
@@ -0,0 +1,54 @@
+// ./lookup.py <number_of_stars> <save_name>
+
+package main
+
+import (
+  "fmt"         // printing
+  // "os"          // system arguments
+  "math"
+)
+
+const sigma = 200
+const f_0 = 0.1
+const R_s = 1e4
+const pi = 3.141592
+// e = math.e
+const G = 4.302e-3
+
+func rho(r int) float64 {
+  var a float64 = (1000) / (math.Sqrt( 2 * pi ) * sigma )
+  var b float64 = r / sigma * sigma
+  var c float64 = math.Exp(float64(b))
+  var d float64 = float64(a) * float64(c)
+  return d
+}
+
+// # rho function
+// def rho(r):
+//     a = (1) / (math.sqrt( 2 * pi ) * sigma )
+//     b = math.exp( - (phi(r) / sigma ** 2 ) )
+//     return a * b
+
+// func phi(x int) float64 {
+//   // if x == 0{
+//   //   return -4 * pi * f_0 * G * (R_s * R_s)
+//   // } else {
+//   //   a := - ( 4 * pi * G * f_0 * (R_s * R_s * R_s) ) / x
+//   //   b := 1 + (x / R_s)
+//   //   c := math.Log(b)
+//   //   d := a * b
+//   //   return d
+//   // }
+// }
+
+func main(){
+  // nos := os.Args[1]
+  // save := "/data/" + string(os.Args[2]) + ".csv"
+
+  fmt.Println(float64(rho(1e6)))
+  fmt.Println(float64(rho(3e6)))
+  fmt.Println(float64(rho(5e6)))
+  fmt.Println(float64(rho(7e6)))
+  fmt.Println(float64(rho(9e6)))
+
+}