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!
Solar System Calculator
Solar System Calculator
- Attachments
-
- SSC1.ZIP
- (122.55 KiB) Downloaded 47 times
-
- SSC.jpg (143.9 KiB) Viewed 393 times
-
- SSC.PRG
- (1.88 KiB) Downloaded 35 times
-
- SSC.BASL.TXT
- (3.47 KiB) Downloaded 37 times
Last edited by voidstar on Fri Sep 27, 2024 5:28 pm, edited 3 times in total.
Re: Solar System Calculator
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.
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.
Re: Solar System Calculator
I agree, the original system I did that program on didn't have much for formatting - at least nothing that was very portable across BASIC's.
EDIT: Another version of the program, I had it ask which output you wanted (min, max, avg), so it then only showed that category and only had one set of numbers to deal with (and easier for formatting)
On the X16, we could use LOCATE - but then you either have to hardcode the layout, or do a SYS call to figure out what your current row is. So I offer the base version just as a starting point.
EDIT: Another version of the program, I had it ask which output you wanted (min, max, avg), so it then only showed that category and only had one set of numbers to deal with (and easier for formatting)
On the X16, we could use LOCATE - but then you either have to hardcode the layout, or do a SYS call to figure out what your current row is. So I offer the base version just as a starting point.