Pure Programmer
Blue Matrix


Cluster Map

Project: Milky Way Stellar Density Estimate

Estimate the average [[stellar density]] of the [[Milky Way]] Galaxy. The stellar density is the number of stars per volume. Assume that the volume of the Milky Way is calculated as in project MilkyWayVolume and that the number of stars is 100 - 400 billion. Because we don't know the exact number of stars, allow the user to pass the number of stars in on the command line.

Also compute the size of box with a star in the middle that would correspond to the stellar density calculated. (Hint: Take the cube root of the reciprocal of the stellar density) This is the average distance between stars if the the galaxy were homogenious (which it is not) and if stars were stacked in little boxes of the same size (which they are not). What would the number of stars need to be in order to correspond to the distance to our nearest neighbor star [[Proxima Centauri]] at 4.2465 light-years?

Output
$ swiftc MilkyWayStellarDensity.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation) $ swiftc MilkyWayStellarDensity.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution