From: Timo Kokkonen Date: Fri, 2 Apr 2010 09:59:03 +0000 (+0300) Subject: setup_planet: Concentrate the mass mostly in the middle of the system X-Git-Url: http://git.itanic.dy.fi/?p=sdl-planets;a=commitdiff_plain;h=5a5899350747bf777228972ff2602138ff07d036 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 --- 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);