Closed jessegreenberg closed 8 years ago
In the commit above, the nucleon radius is now optional in ParticleAtom. @andrewadare would you mind reviewing these changes since you recently gave shred a full review?
Pinging @jbphet in case he would like to take a look as well.
@jessegreenberg Great idea to make the radius configurable. You've removed the 1.35 as a "magic number" from the radius scaling, which is a plus. (Couldn't resist the play on words there).
On the other hand, looks like you've introduced a new set of magic numbers in the linear mapping here. You followed a good practice by noting when hard-coded parameters were eyeballed, but it would be even better to assign to meaningfully-named var
s the input/domain boundaries (the first two args) and the output/range boundaries (the second two args).
Also, it would help to add a bit more to the comment explaining exactly what you're visually trying to achieve with this.
It's especially valuable to do so because the independent variable range is reversed (wouldn't hurt to explain that). Typically, wouldn't people reverse the range of the output variable to make it clearer that the mapping has a negative slope?
All great points @andrewadare, thanks for the review! Commit above should enhance clarity of the linear map with factoring and additional documentation. Assigning back to @andrewadare for further discussion if necessary.
LGTM, all my points have been addressed.
Great, thanks for reviewing @andrewadare! Closing.
For use in rutherford-scattering, it would be helpful if the nucleon radius could be added to options. Nucleons in rutherford-scattering are much smaller than isotopes-and-atomic-mass and build-an-atom.
Also, for multiple nucleons (more than 5) the radius of a single z layer of particles is calculated by
placementRadius += nucleonRadius * 1.35 / level;
The nucleus in rutherford-scattering can have up to 250 nucleus, and scaling by 1.35 makes the nucleus look quite dense. It would be helpful if 1.35 could change. Maybe it could be a function of the number of nucleons and the width of an single particle.
From https://github.com/phetsims/rutherford-scattering/issues/59