blob: 37bc821222a2d049ec0086fd55cf67946b93fe5a (
plain)
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
35
36
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)
|