The Beginnings of Our Interstellar Exploration

Despite an apparent lack of interest in space exploration by our government here in the United States, the notion of interstellar travel is an important idea in the public consciousness.  Many of us are anxiously awaiting the new Star Trek film — we need our “fix” of a speculative future where humanity lives not on a single world, but on a multitude of different planets and can travel at will between them.  Space Travel is part of our culture, and we can’t get enough.

Even as we wait for NASA to regain a nominal ability for manned space exploration with the new (and not particularly creatively named) Space Launch System and Crew Exploration Vehicles, we can find some interest in the fate of our (somewhat dated) unmanned spacecraft that have left, or are about to leave, the confines of our local solar system and have made it into interstellar space.  These are the emissaries of our species, and it’s interesting to think about where they are going and what they will encounter.

There are currently five such spacecraft that have reached escape velocity and are on a heading for the unknown regions of deep space beyond the influence of our home star.  Two are presumably “dead” and lack the ability to report any information back to us.  Three are still functional at some level and can communicate basic telemetry back to Earth, if only we continue to listen.  Both Voyager spacecraft are transmitting as is the New Horizons probe that recently left Pluto and headed towards the edges of the known solar system.  Listening to their reports is often tedious and can become expensive, but every bit of data that they transmit is new information about a region of space that is almost completely unknown.  I hope that our technology continues to improve and allows us to listen to these data streams for as long as possible.  Ignoring them would be a crime — a crime that the right-wing partisans in Washington are all-to-ready to commit.

Extrasolar Spacecraft

 

Circles, High Resolution Graphics, and Remedial Math

It was a simple question, really: “How do you draw a circle on the screen?”

Some programming languages have a nice set of graphic primitives that let you specify the coordinates and radius and draw a circle with a single statement… Heck, even the Commodore Plus 4 supported this.  Microsoft BASIC on the Macintosh did.  I even vaguely remember something in the current version of Visual Studio that lets you do this without too much trouble.

Sadly, Applesoft does not and the young programmer in question was working on an ancient Apple IIe that was already considered “Vintage” when he was born.

I’m told there are ways of generating the Cartesian Coordinates of points on a circle without using the Sine or Cosine function… Some other genius can show you this on their own time, but I got wrapped up in essentially converting polar coordinates to Cartesian and Applesoft conveniently DOES have the Sine and Cosine functions readily accessible, even if they are somewhat slow.  The meat of the program are these two functions:

x = r * cos (theta)

y = r * sin (theta)

Where x and y are the Cartesian coordinates of points on the circle, arc, or curve; r is the radius from the central point; and theta is the angle from the horizontal.

Complicating this somewhat, for someone who was taught to think about angular measure in degrees is the fact that Applesoft BASIC uses radians.  We convert degrees to radians by multiplying the angle in degrees by the value of pi divided by 180:

radians = degrees * (PI / 180)

We also need to consider that the screen coordinates place the origin in the upper left-hand corner of the screen and are all positive integers.  Since our functions for X and Y are going to give us negative values, we have to redefine the origin as the middle of the screen:

Cx = INT (280 / 2)

Cy = INT (192 / 2)

Where Cx is the center of the screen along the X axis (Horizontal) and Cy is the center of the screen along the Y axis (Vertical.) By adding the X and Y coordinates generated by our earlier function t0 Cx and Cy, we can plot even those points where the functions give us negative numbers.

So, thus far we can convert Radians to Degrees, convert Polar coordinates to Cartesian, and map those “absolute” coordinates to our actual screen.  The next part of the procedure is simply to step through all “360 Degrees” of the circle and plot those points that lie on the circle. The sample code looks like this:

 1000 TEXT : HOME : SPEED= 255
 1010 HGR2 : HCOLOR= 3
 1020 LET PI = 22 / 7
 1021 LET CX = INT (280 / 2)
 1022 LET CY = INT (192 / 2)
 1030 DEF FNR(D) = D * (PI / 180)
 1050 DEF FNX(D) = R * COS(FNR(D)) + CX
 1060 DEF FNY(D) = R * SIN(FNR(D)) + CY
 1070 LET R = 90
 1080 FOR T = 0 TO 360
 1090 HPLOT FNX(T), FNY(T)
 1100 NEXT T
 1110 END 

And generates the following display on the Apple Iie emulator:

A2E_Circle_Plot

A line-by-line examination of the program follows:

1000 – Sets text mode, clears the screen, and sets the output speed to maximum. Since we don’t know any of these states when we begin execution, this is just precautionary.

1010 – Sets the full-screen high resolution graphics mode and sets the output color to white.

1020 – This defines our constant pi using the rough approximation I learned back in Junior High.

1021 – This defines constant Cx as the center of the screen along the X-Axis.

1022 – This defines constant Cy as the center of the screen along the Y-Axis.

1030 – This user-defined function converts an angle measured in degrees (D) to an angle measured in Radians (R)

1050 – This user-defined function finds the X-coordinate of each point given the angle and radius.

1060 – This user-defined function finds the Y-coordinate of each point given the angle and radius.

1070 – This defines our radius (R) as 90 pixels.

1080 – This marks the beginning of a FOR loop that will step through all 360 degrees of angle T (Theta) that define the circle.  If we wanted to draw an arc instead of a circle, we could limit the range of T to the beginning and end of the arc.

1090 – This plots each point that lies on the circle, as computed by the user-defined functions above.

1100 – This line completes the FOR/NEXT control structure.

1110 – This line marks the end of the program and terminates execution.

Yes, the program works but it’s rather slow and it turns out that we can speed-up execution a bit by treating our circle as a polygon with n equal sides. We accomplish this by adding a STEP value to our FOR/NEXT loop and “remembering” the previous point so that we can draw a straight line between them.

Edit the program as follows:

 1075 LET OX = FNX(O):OY = FNY(0)
 1080 FOR T = 15 TO 360 STEP 15
 1090 HPLOT OX,OY TO FNX(T), FNY(T)
 1096 LET OX = FN X(T):OY = FNY(T)

Line 1075 finds the first X and Y values at T=0 and stores those values in variables Ox and Oy.

Line 1080 is edited to reflect that we’re now starting at T=15 and working towards 360 in 15 degree steps.

Line 1090 is edited to now draw a line from the “old” coordinates specified by OX,OY and the “current” coordinates found by FNX(T) and FNY(T).

Line 1096 is added to update the values of OX and OY to the “current” values and storing them for the next iteration of the loop.

Drawing the circle in 15 degree steps makes the outline of the circle a little rougher, but the program only loops 23 times versus 360 times in the previous version.  Here’s a sample of the output generated by the revised program:

A2E_Circle_Plot2

Although the circle shown here is a little “rough”, this is actually a worst-case scenario since this is probably the largest circle you can practically draw on the Apple II screen — smaller circles will show less irregularity due to the jagged plot lines.

Good Night, All!

 

Future Past

thm_bytedec1977cover-Starrek

The December 1977 issue of Byte magazine featured an illustration of the Enterprise (ST: TOS) crew visiting a museum and looking at an exhibit of a 20th century computer enthusiast seated at the DecWriter console of his S-100 computer system, evidently trying to key-in or debug a program from a bound book.  The book bears a striking resemblance to a later reprint of the classic 1973 “BASIC Computer Games” by David Ahl.  A somewhat self-referential paradox is that one of the longer and more complex games published in the book is titled “Super Star Trek.”

basic_computer_games

Access to the Old Content

Paleoferrosaurus

[HOME] [DOCUMENTS] [FLICKR] [YOUTUBE] [Gallery2][WEATHER]

 

Quick Links to Editorial Content:

The UNIVAC 90/60 Fan Page

Wang 5506-2 Terminal / Workstation

Erie County Dept. of Public Safety (WebCad)

EMS Charts for Patient Care Reports and Human Resources

West County Fire Control — Legacy Webpage

The Original “Computer Collection” Document

The Gudgeonville Covered Bridge

Fun and Games with the Commodore 64

Moving the Valley School

Local Railroad History

The Grand Trunk Western 4070 that pulled excursion trains at Conneaut Lake Park

Fairview Engine #45

The DecMate VT-278

Where to get Classic Macintosh Software

Macintosh Software Collection

What to do “After the Fire”

Childhood Homes Revisited

A Timeline of the MacArthur Ancestors

Children of Arthur (By Michael A. McCabe)

This page last revised on April 13, 2016 by Micheal H. McCabe

Changes at Paleoferrosaurus

Hand-coded HTML was getting fairly tedious to write and maintain, so in the spirit of 1995, I’ve switched to the WordPress content management system for this website.  Right now, it’s purely an experiment — I might switch back to a traditional home-page someday.  Most of the existing content will be preserved, but it might take me some time to migrate everything over to the new system.  In the meantime, wish me luck in keeping this old-school personal web-page alive!

Thanks!

–Paleoferrosaurus (Micheal H. McCabe)