ScratchData LogoScratchData
Back to jackson49's profile

Mars Live Distance

JAjackson49•Created April 24, 2023
Mars Live Distance
64
45
357 views
View on Scratch

Instructions

This program calculates the live distance of Mars with reasonable accuracy using Kepler's Laws of Planetary Motion. It doesn't use cloud variables. Instead, it's build around the Days Since 2000 block, Kepler’s equation, and some trigonometry. -Explanation of Each Component- Grey Outlined Box: Shows the positions of Mars and Earth in their orbit around the Sun. The distances are to scale, although the sizes of the objects are not. Miles/KM from the Sun: Probably pretty self-explanatory. This counter shows the approximate distance between Mars and the Sun. It has a small margin of error, but is pretty accurate. Miles/KM from the Earth: Self-explanatory. Shows the approximate distance between Mars and Earth. I’m still trying to improve this counter’s accuracy; at times, it can be up to a few million miles off of the actual value. Apparent Magnitude: This indicates how bright Mars currently appears from Earth. Counterintuitively, lower numbers are brighter and higher numbers are fainter. It's known as an inverse scale. Mars' apparent magnitude ranges from about -2.9 to +1.8. It’s brightest during opposition, when it's closest to Earth, which occurs about once every two years. This is known as an opposition because it happens when Mars is in the opposite direction in the sky as the Sun. Angular Diameter: Indicates how large Mars appears from Earth. When Mars is farther away from Earth, it appears smaller, and when it's closer, it appears larger. The angular diameter of Mars can range from 3 arcseconds (when it's farthest from Earth) to 26 arcseconds (when it's closest). More information: https://en.wikipedia.org/wiki/Angular_diameter Phase: Much like the Moon, Mars exhibits phases. However, since we are closer to the Sun than Mars is, we can only see Mars from an angle where it appears to be nearly 100% illuminated. The smallest possible phase that we can see from Earth is about 88%. Constellation: As Mars and Earth orbit the Sun, Mars moves across the night sky. I thought it'd be an interesting challenge to calculate the constellation that Mars appears to be in from Earth. It isn't perfectly accurate, but it's reasonably close. Imperial/Metric: By clicking these two buttons, you can switch between miles and kilometers

Description

Pen Text Engine created by @-Rex- I used JPL Horizons for a lot of the data I needed: https://ssd.jpl.nasa.gov/horizons/app.html If this is taking too long to load, try Turbowarp: https://turbowarp.org/840364224?hqpen -Kepler- This project is primarily based on the work of a 17th-century astronomer and mathematician named Johannes Kepler. In the early 1600s, he focused his attention on the motions of the planets. Using meticulously accurate observations by other astronomers, such as Tycho Brahe, he discovered that the planets orbit the Sun in ellipses (ovals). Between 1609 and 1619, Kepler developed his three laws of planetary motion, becoming the first person in history to accurately define how the planets orbit the Sun. His work provided the basis for the theory of universal gravitation that Isaac Newton would formulate 50 years later. This project utterly depends on Johannes Kepler's work in order to compute the positions of the planets as a function of time. Even 400 years later, his ingenious planetary laws remain useful. Kepler's First Law: Planets orbit the Sun in ellipses with the Sun at one focus of the ellipse. Kepler's Second Law: An imaginary line between the Sun and a planet would sweep out equal areas in equal amounts of time. Planets orbit faster when they're closest to the Sun, and slower when they're farthest. Kepler's Third Law: A planet's orbital period squared is directly proportional to its semi-major axis (average distance from the Sun) cubed. It's not directly needed in this project, but the orbital elements I used follow this law. -Update Log- 5/11/2023: Used the modulo block to significantly speed up the loading time. 5/13/2023: I updated the Earth-Mars distance to use the true anamolies, which are the angles relative to the Sun, instead of the eccentric anamolies, which are angles relative to the center of the ellipses of Earth and Mars' orbits. It improved the accuracy by quite a bit. I also fixed a minor problem where the date would glitch on January 1st. 5/23/2023: Added in orbital inclination. To be honest, it did almost nothing to improve the accuracy. I also modified the Mars-Sun and Earth-Sun distances to use the true anomaly instead of the eccentric anomaly, which did improve the accuracy by quite a bit. 6/2/2023: Fixed most of the problems with the constellation tracker. Still not perfect, but it's at least fairly accurate now. 6/7/2023: Temporarily removed inclination since it was causing problems with the accuracy of the Earth-Mars distance. 7/28/2023: Minor adjustment to the apparent magnitude calculator. 5/2/2024: Minor adjustment to the constellation tracker 5/9/2024: Modified the iteration system for finding the eccentric anomalies. The project now loads faster. -Music- -Arabesque No. 1 by Claude Debussy. I believe it’s performed by Rousseau (the piano player, not the 18th century philosopher). -BWV 1068 by Johann Sebastian Bach - Waltz of the Flowers from The Nutcracker by Pyotr Ilyich Tchaikovsky (during November and December). Performed by the Concert Band of the US Air Force Band. -Venus from The Planets by Gustav Holst (when Mars is close to opposition). I see the irony.

Project Details

Project ID840364224
CreatedApril 24, 2023
Last ModifiedJanuary 8, 2025
SharedMay 6, 2023
Visibilityvisible
CommentsAllowed