Solar System Calculator

Post Reply
voidstar
Posts: 451
Joined: Thu Apr 15, 2021 8:05 am

Solar System Calculator

Post by voidstar »

Adapted from a prior PET example, this calculates how far along a fence to draw the planets at scale to each other.

The two inputs are how long is your fence (in feet) and how many planets you want to include in your model (1-9, yep I included Pluto anyway).

However, planet orbits aren't perfectly circular - they will have a min (nearest to sun) distance, max (furthest from sun), and an average distance to the sun. This program calculates all 3 of those, so you can choose which one to use in your fence model (I'd generally use average).

There is an Easter Egg in this program if you use inputs "108" and "8" (fence length 108 and 8 planets), exclusive to the X16 :) (however it requires the R48 ROM update, due to using OVAL and RING - since BASIC is interpreted on the fly, you can run the rest of the program with older ROM -- the TryItNow emulator is not yet updated to R48)


Try It Now!
Attachments
SSC1.ZIP
(122.55 KiB) Downloaded 8 times
SSC.jpg
SSC.jpg (143.9 KiB) Viewed 89 times
SSC.PRG
(1.88 KiB) Downloaded 4 times
SSC.BASL.TXT
(3.47 KiB) Downloaded 6 times
Last edited by voidstar on Fri Sep 27, 2024 5:28 pm, edited 3 times in total.
voidstar
Posts: 451
Joined: Thu Apr 15, 2021 8:05 am

Re: Solar System Calculator

Post by voidstar »

Here is an example of the normal runtime:

Say you have a 40ft fence along your backyard, and you want to depict a model of the first 8 planets. Alternatively, if you didn't much care about the outer planets, you could just put 4.

Then the program calculates how many inches from the edge of the fence that each planet should be drawn, in order to accurately maintain a scaled model of the N chosen planets. The first column in the results is the MIN distance, then MAX distance, and the last column is the AVERAGE distance.

In this specific example, Mercury would be 5inches (almost half a foot), while NEPTUNE would be at 39.5ft (using the last column, the average overall distance from the sun). The distances are scaled to the planets max range.


The program is an example of using multiple DATA sections. It can work "as-is" but the "Easter Egg" special (108ft 8 planets) uses OVAL and RING keywords that require ROM R48 update.

ssc_example.jpg
ssc_example.jpg (143.66 KiB) Viewed 86 times
Post Reply