- #1
corndog16
- 1
- 0
Hey all.
I'm working on a personal programming project where I'm attempting to simulate (to a small degree) a galaxy. And I have come across a decent 2D density map for a spiral galaxy. This map (array actually) defines a 128x128 grid of values between 0 and 255 representing the frequency of stars found in that 'sector' of space.
I want to expand this density map into the 3rd dimension and I figure a good way to do that would be to define the height of the galaxy as being n sectors tall and then use a normal distribution curve to distribute the density value (something between 0 and 255) vertically across those 5 sectors.
My question is, how would I take a number, say 234, and divide it among n 'boxes' or 'sectors' so that it has a normal curve type distribution?
I attempted to Google this, but I found that what was coming up did not describe what I was looking for so I'm thinking that I don't currently have the vocabulary to describe this particular intent.
I'm working on a personal programming project where I'm attempting to simulate (to a small degree) a galaxy. And I have come across a decent 2D density map for a spiral galaxy. This map (array actually) defines a 128x128 grid of values between 0 and 255 representing the frequency of stars found in that 'sector' of space.
I want to expand this density map into the 3rd dimension and I figure a good way to do that would be to define the height of the galaxy as being n sectors tall and then use a normal distribution curve to distribute the density value (something between 0 and 255) vertically across those 5 sectors.
My question is, how would I take a number, say 234, and divide it among n 'boxes' or 'sectors' so that it has a normal curve type distribution?
I attempted to Google this, but I found that what was coming up did not describe what I was looking for so I'm thinking that I don't currently have the vocabulary to describe this particular intent.