Exercise 3.5: Visualization of the solar system The innermost six planets of our solar system revolve around the Sun in roughly cir- cular orbits that all lie approximately in the same (ecliptic) plane. Here are some basic parameters: 118 3.5 | ANIMATION Object Mercury Venus Earth Mars Radius of object (km) 2440 6052 6371 Radius of orbit (millions of km) 57.9 108.2 149.6 Period of orbit (days) 88.0 224.7 365.3 314 Object Mercury Venus Earth Mars Jupiter Saturn Sun Radius of object (km) 2440 6052 6371 3386 69173 57316 695500 Radius of orbit (millions of km) 579 108.2 149.6 2279 778.5 1433.4 Period of orbit (days) 88.0 224.7 365.3 687.0 4331.6 10759.2 Using the facilities provided by the visual package, create an animation of the solar system that shows the following: a) The Sun and planets as spheres in their appropriate positions and with sizes pro- portional to their actual sizes. Because the radii of the planets are tiny compared to the distances between them, represent the planets by spheres with radiiy times larger than their correct proportionate values, so that you can see them clearly. Find a good value for that makes the planets visible. You'll also need to find a good radius for the Sun. Choose any value that gives a clear visualiza- tion. (It doesn't work to scale the radius of the Sun by the same factor you use for the planets, because it'll come out looking much too large. So just use whatever works.) For added realism, you may also want to make your spheres different colors. For instance, Earth could be blue and the Sun could be yellow. b) The motion of the planets as they move around the Sun (by making the spheres of the planets move). In the interests of alleviating boredom, construct your pro gram so that time in your animation runs a factor of faster than actual time Find a good value of that makes the motion of the orbits easily visible but not unreasonably fast. Make use of the rate function to make your animation run smoothly. Hint: You may find it useful to store the sphere variables representing the planets in an array of the kind described on page 115. Exercise 3.5: Visualization of the solar system The innermost six planets of our solar system revolve around the Sun in roughly cir- cular orbits that all lie approximately in the same (ecliptic) plane. Here are some basic parameters: 118 3.5 | ANIMATION Object Mercury Venus Earth Mars Radius of object (km) 2440 6052 6371 Radius of orbit (millions of km) 57.9 108.2 149.6 Period of orbit (days) 88.0 224.7 365.3 314 Object Mercury Venus Earth Mars Jupiter Saturn Sun Radius of object (km) 2440 6052 6371 3386 69173 57316 695500 Radius of orbit (millions of km) 579 108.2 149.6 2279 778.5 1433.4 Period of orbit (days) 88.0 224.7 365.3 687.0 4331.6 10759.2 Using the facilities provided by the visual package, create an animation of the solar system that shows the following: a) The Sun and planets as spheres in their appropriate positions and with sizes pro- portional to their actual sizes. Because the radii of the planets are tiny compared to the distances between them, represent the planets by spheres with radiiy times larger than their correct proportionate values, so that you can see them clearly. Find a good value for that makes the planets visible. You'll also need to find a good radius for the Sun. Choose any value that gives a clear visualiza- tion. (It doesn't work to scale the radius of the Sun by the same factor you use for the planets, because it'll come out looking much too large. So just use whatever works.) For added realism, you may also want to make your spheres different colors. For instance, Earth could be blue and the Sun could be yellow. b) The motion of the planets as they move around the Sun (by making the spheres of the planets move). In the interests of alleviating boredom, construct your pro gram so that time in your animation runs a factor of faster than actual time Find a good value of that makes the motion of the orbits easily visible but not unreasonably fast. Make use of the rate function to make your animation run smoothly. Hint: You may find it useful to store the sphere variables representing the planets in an array of the kind described on page 115