From 1b1e0bfd1a5e9d88886b58b0d4db05cafbb36365 Mon Sep 17 00:00:00 2001 From: hanemile Date: Fri, 9 Feb 2018 13:42:24 +0100 Subject: added the spiral folder --- src/python/spiral/exec.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 src/python/spiral/exec.py (limited to 'src/python/spiral/exec.py') diff --git a/src/python/spiral/exec.py b/src/python/spiral/exec.py new file mode 100755 index 0000000..37bc821 --- /dev/null +++ b/src/python/spiral/exec.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 + +import galaxytools as galaxytools +import time as time +# import matplotlib.pyplot as plt + +# start the timer +start = time.time() + +# generate a new galaxy +galaxy = galaxytools.new_galaxy(64) + +# generate 100 stars +galaxy.gen_new_stars(1000) + +# galaxy.print_stars() + +# calculate the forces acting inbetween the stars +galaxy.calc_all_forces() + +# print out the individual forces acting on each star +# galaxy.print_individual_forces() + +galaxy.gen_sphere_positions(0.0001) +# galaxy.gen_forces_after_t(1) + +galaxy.is_star_in_sphere_all() + +# save the stop time +end = time.time() + +# calculate the elapsed time +whole_time = end - start + +# print the time and append it to a list +print("Time:") +print(whole_time) -- cgit 1.4.1