Galaxy: A few more tweaks to the Radius generation
Galaxy: A few more tweaks to the Radius generation

file:a/Galaxy.cs -> file:b/Galaxy.cs
--- a/Galaxy.cs
+++ b/Galaxy.cs
@@ -39,20 +39,29 @@
 			
 			for (int i = 1; i <= NumStars; ++i)
 			{
-				double Radius = rand.NextDouble() * (double)GalaxyRadius;
-				Radius *= rand.NextDouble();
+				double Radius = (double)GalaxyRadius * rand.NextDouble() * rand.NextDouble();
+
+//				Ziggy is using this method to get a better-looking distribution in the hub, but it doesn't translate well to the whole galaxy.
+//
+//				double Radius = (double)HubRadius;
+//				while (true)
+//				{
+//					Radius *= 1.618 * rand.NextDouble();
+//					if (rand.NextDouble() > 0.8 || (Radius > (double)GalaxyRadius)) { break; }
+//				}
+//				Radius += (2d * rand.NextDouble() - 1d) * GalaxyRadius * .1;
+
 				double Phi, Theta;  // Rotational angles for some spherical coordinates.
 				double x, y, z;  // Cartesian coordinates, maybe?
 				
 				// If the radius puts the star outside the Hub (be fuzzy), we need to align it in an arm.
 				if (Radius > (HubRadius + rand.NextDouble() * ( rand.NextDouble() * 2 - 1 ) * ( DiskRadius - HubRadius)))
 				{
-
 					// This spiral algorithm was taken from the python Galaxy Generator found here: http://www.ailis.de/~k/archives/29-Galaxy-Generator.html
 					// Rotate the star by the specified number of rotations, then
 					// multiply by the proportional distance from center to give
 					// curvature.
-					Phi = ((TwoPi * (double)ArmRotations * Radius / (double)DiskRadius)
+					Phi = ((TwoPi * (double)ArmRotations * Radius / (double)GalaxyRadius)
 					             // Then move the point further around by a random factor up to ArmWidth
 					             + rand.NextDouble() * (double)ArmWidth
 					             // Then add a factor of omega, putting the point into one of the arms.

 Binary files a/bin/Release/galaxy_generator.exe and b/bin/Release/galaxy_generator.exe differ