-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
magic numbers in CartoonModelList #186
Comments
Factored out some of these into constants, and documented as best I can without knowing for sure where these came from (ported directly from Java with all comments). Regarding 365.0 / 334.0, the 365 seems like is must refer to days in a year, but I am not 100% sure where these numbers came from. I am inclined to leave it as is. Perhaps @samreid has some memory of this? |
This is fuzzy in my mind, but I recall manual adjustment of values was necessary to produce the desired macroscopic behavior. The code comment in the context is: // Have to artificially scale up the time readout so that Sun/Earth/Moon mode has a stable orbit with correct
// periods since masses are nonphysical
this.timeScale = 365.0 / 334.0; |
Assigning to @pixelzoom for review. |
@samreid In #186 (comment), is |
In this model, yes. |
Thanks. Noted in source code doc. |
Related to code review #173.
There are numerous magic numbers in CartoonModelList.
Issues:
• Some of these constants are documented as "tuned by hand", some are not documented. All magic numbers should be documented, along with any dependencies that other things may have on this numbers. (Eg, "If you change foo, be sure to change bar.")
• Some are duplicated in multiple places. For example
this.sun.radius *= 50
appears in 2 places. If I change one, do I need to change the other? Similarly forthis.earth.radius *= 800
.•
this.timeScale = 365.0 / 334.0
is odd. Is there a significance to the numerator and denominator values? If so, document. If not, collapse to a single number.The text was updated successfully, but these errors were encountered: