From 5a5899350747bf777228972ff2602138ff07d036 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 2 Apr 2010 12:59:03 +0300 Subject: [PATCH] setup_planet: Concentrate the mass mostly in the middle of the system This will increase the stability of the created planetar system. Most of the central planets collapse into one large object, which will keep most of the system more stable. Signed-off-by: Timo Kokkonen --- planet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planet.c b/planet.c index 1cf5d1e..c7b01a0 100644 --- a/planet.c +++ b/planet.c @@ -51,7 +51,7 @@ static void setup_planet(struct planet *p, double mass, double total_mass, double velocity; double distance; - distance = radius * get_random_double(); + distance = radius * pow(get_random_double(), 2); velocity = sqrt(total_mass / radius); velocity *= pow(distance / radius, 0.2); -- 2.45.0