diff --git a/perso/box.o b/perso/box.o index e6c4b02f142d1ed6c6e7da93d2d97b39f4f40ff4..129a44f116636faa80b57d7d9f37f7add433a818 100644 Binary files a/perso/box.o and b/perso/box.o differ diff --git a/perso/galaxy.c b/perso/galaxy.c index 099bba2c6b60424f60e66acf38e0389eee306968..2588f3265950a0b3141521a05966dbf9f56a27b8 100644 --- a/perso/galaxy.c +++ b/perso/galaxy.c @@ -45,7 +45,6 @@ int main(int argc, char **argv) { double zone = 1e10; Box box_initial = new_box(-zone, zone, zone, -zone); Galaxy* galaxy = create_and_init_galaxy(nb_stars, box_initial, DELTA_T); - @@ -94,11 +93,11 @@ Galaxy* create_and_init_galaxy(int nb_bodies, Box box, double delta_t) { } else { double m_i = random_mass(); - Vector v_i = random_speed(r_i, m_i); Vector r_i; do { r_i = random_position(); } while (!is_inside(box, r_i)); + Vector v_i = random_speed(r_i, m_i); temp = new_star_vel(r_i, v_i, *v_null, m_i, 0.0); diff --git a/perso/galaxy.h b/perso/galaxy.h index e12526cd1a6ed8c6009bb4179c37111b45312617..e787e83f87896ce98ca9bc1a1161eaee04f20875 100644 --- a/perso/galaxy.h +++ b/perso/galaxy.h @@ -62,6 +62,7 @@ void resize_galaxy(Galaxy* galaxy); // fait les tests de toutes les librairies void tests(); +void tests_galaxy(); diff --git a/perso/galaxy.o b/perso/galaxy.o index dc8201a55f65e9bc22c0802e3b356f7227fa60e9..1df40a75eea1b60e75f70e20c9ce36ad00cb4b51 100644 Binary files a/perso/galaxy.o and b/perso/galaxy.o differ diff --git a/perso/quadtree.h b/perso/quadtree.h index f2b038e76a0e162d919bb90be92dc144bb3519f7..4420243a34af9e0af5066edd1621bf6af3958342 100644 --- a/perso/quadtree.h +++ b/perso/quadtree.h @@ -20,6 +20,7 @@ typedef struct __quadtree { + /* * * * * * * * * * * * * * * * * * * * --- PROTOTYPES --- * diff --git a/perso/quadtree.o b/perso/quadtree.o index 5e45a26e4af17d5e7f4ce9cd1746b362fd901e29..97e84ad8deccc08420df3195c81a68e4a73100be 100644 Binary files a/perso/quadtree.o and b/perso/quadtree.o differ diff --git a/perso/star.c b/perso/star.c index 3159364d6432509ac23013d2c6debb95ba1288b4..99b022072e88e71fa8f749b705250761dbc7a87e 100644 --- a/perso/star.c +++ b/perso/star.c @@ -131,19 +131,17 @@ Star* super_star(Star* list_stars, int selection, int size_list) { } -Vector* resultante(Vector* list_stars, int size_list) { +Vector* resultante(Star** list_stars, int size_list) { Vector* Fi = new_vec(0.0, 0.0); for (int i = 0; i < size_list; i++) { for (int j = 0; j < size_list; j++) { if (j != i) { - /* Vector* rj_ri = sub_vec(&(list_stars[j] -> pos), &(list_stars[i] -> pos)); int G_mi_mj = FORCE_GRAVITATION * list_stars[i] -> mass * list_stars[j] -> mass; Vector* temp = mul_vec(rj_ri, G_mi_mj); Fi = add_vec(Fi, temp); - */ } } } diff --git a/perso/star.h b/perso/star.h index 501713c24f0ab28175cfd70e87a9f4f7bba76a9d..d63c8b68a3709c770dcf7a762d5d3eb83eef7799 100644 --- a/perso/star.h +++ b/perso/star.h @@ -48,7 +48,7 @@ void print_star(const Star* const star); // retourne l'accélération d'une étoile d'après toutes les autres d'une liste -Vector* resultante(Vector* list_stars, int size_list); +Vector* resultante(Star** list_stars, int size_list); // calcule la position de l'étoile après avoir subi la force résultante des autres vecteurs (deuxième loi de Newton) void new_position(Star* star, Vector resultante); diff --git a/perso/star.o b/perso/star.o index 248696a09a8d18bba1b68d6db0adcc66507888ad..f509e4d65ccf72b7715aa976c0f2b5ce43b1ab4d 100644 Binary files a/perso/star.o and b/perso/star.o differ diff --git a/perso/vector.o b/perso/vector.o index 3dd097b88be389e7f46799b163748e50ae291077..87a39fd52dd97cb87d85aa67c5c1a514b985472e 100644 Binary files a/perso/vector.o and b/perso/vector.o differ