Celestial BASIC

I recently aquired a copy of Celestial BASIC by Eric Burgess. Published in 1982, it promises to offer ‘Astronomy on your computer’. It contains 23 BASIC program listings originaly written for an Exidy Sorcerer but published in the Apple II BASIC dialect – ‘to make them available to a wider range users’.

Celestial BASC – Astronomy on Your Computer

Rather than simply typing a listing into one of my computers, I decided to pick a program to convert into Turbo Pascal with the aim of running it on my RC2014. After all, I needed to find something to justify my recent purchase of a CP/M expansion …

I tackled program 11 – RADEC (Right Ascension and DEClination for all planets for any date) as the code wasn’t too long. I also had the benefit of a test case I could use to verify that my code was working correctly.

Output from RADEC for 1st December 1982 – showing the heliocentric longitude, distance to the planet from Earth in astronomical units, the Right Ascension in hours and Declination in degrees. A useful test case!

Anyway, after some hours of coding shared between working on the RC2014 using Turbo Pascal 3.01A and Free Pascal 3.0.4 on a Raspberry Pi I now have a working version. The output on the RC2014 is pleasing as it’s just slow enough see each line being printed. The output is far too fast on a Pi to be truly enjoyable 🙂

RADEC running on an RC2014

If you’re interested in having a look at the Pascal code you can find it in my RC2014 code repository. It remains uncommented at the time of writing and isn’t elegant, but it does work.

A footnote for anyone interested in the original BASIC code. While working through the Pascal port I found it had a couple of non-fatal, but space-wasting bugs (geddit?!). The dimesions of the plantary data array on line 550 were larger than they needed to be – DIM PD(9,10) is too generous – DIM PD(9,9) is the correct size. Line 1450 converts a value in radians to degrees that is never subsequently used, so can be safely omitted.