Skip to content
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

Show Earth's mass and show all semi-axes for non spherical bodies #2193

Merged
merged 10 commits into from
Jun 15, 2024

Conversation

JiliTheSpaceboy
Copy link
Contributor

@JiliTheSpaceboy JiliTheSpaceboy commented May 30, 2024

  1. Make it so Earth's mass is shown, considering that Jupiter's mass is also shown even if it simply appears as 1.000 MJ

  2. Objects that are neither spherical or use mesh now show mean radius along with all three semi-axes, using the following format:
    Radius: mean (a × b × c)

  3. kg masses can now uses scientific notation if sufficiently large. No more 20,000,000,000,000,000,000 kg, just 2E+19 kg.

For spherical or mesh objects,
Radius: [radius]

For spheroids or ellipsoids,
Radius: [mean] ([a] × [b] × [c])
@JiliTheSpaceboy
Copy link
Contributor Author

I don't know how to compile so this is untested and likely needs some fixing, so I decided to make a pull request.

@JiliTheSpaceboy
Copy link
Contributor Author

TODO:

  • Make small masses (unit: kg) use scientific notation
  • Move radius if elses into displayRadius function
  • Clean up Radius display; for triaxial radii, make all values use the same unit and putting said unit only once at the end; possible dynamic sigfig?

Previously, the 'default' else case shows triaxial radii; I figured that making this case show just one value is more future-proof.
src/celestia/hud.cpp Outdated Show resolved Hide resolved
src/celestia/hud.cpp Outdated Show resolved Hide resolved
src/celestia/hud.cpp Outdated Show resolved Hide resolved
@375gnu 375gnu changed the title hud.cpp Show Earth's mass and show all semi-axes for non spherical bodies Jun 15, 2024
@375gnu 375gnu merged commit 4d9ef08 into CelestiaProject:master Jun 15, 2024
8 checks passed
Copy link

sonarcloud bot commented Jun 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants