Sun Compass documentation

Sun Compass is a BASIC program that is intended for use within a Tandy Model 100/102 laptop.  As its name implies, Sun Compass uses the light from the Sun in order to establish compass orientation to a very high order of accuracy.  Whereas a magnetic compass suffers inaccuracy due to the local "Magnetic Declination" of the geographic area in which it is used, as well as inaccuracy due to influences by nearby iron-bearing metal objects (e.g., steel) and by nearby magnetized objects, Sun Compass does not suffer such inaccuracies.

Overview

Sun Compass is a real-time software application which has an update period of 10 seconds.  Every 10th second, Sun Compass updates all of the time varying information that it presents on the Liquid Crystal Display (LCD) screen of the laptop.  Time varying information includes the following items.
•	21st century date in 2-digit month/2-digit day/4-digit year format
•	24 hour time-of-day in 2-digit hour:2-digit minute:2-digit second format
•	the "equation of time" in plus or minus minutes and seconds format
•	solar declination in plus or minus degrees format
•	solar altitude in plus or minus degrees format
•	solar azimuth in degrees East of North format
•	hour angle in plus or minus degrees format
•	rotating shadow-line in graphic pixel format
Sun Compass also presents the unvarying information of geographic location on Earth by its Latitude and Longitude coordinates in plus or minus degrees format.

At the 30th character column of the LCD (i.e., at about 3/4 of its horizontal width), Sun Compass places a vertically-stacked, up-arrow-headed, "North" indicator that divides the LCD into two panels: a left-hand panel which spans 29 character columns of width and 8 character rows of height, and a right-hand panel which is a square graphic display area measuring 1-7/8" by 1-7/8".  The left-hand panel is where Sun Compass presents textual information.  The right-hand panel is where Sun Compass presents the rotating shadow-line, with one end situated at the exact center of the square graphic display area and with the other end of the shadow-line radially extending to 15/16" of length.

Preparation

The first time Sun Compass is used, some preparation is needed in order to adapt it to your geographic location on Earth and to adapt it in regard to the particular time zone that you use as the reference of the time-of-day clock in your laptop.

Latitude and Longitude coordinates are needed to specify your location on Earth.  See URL below.

http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=104873724848642050832.000458222c9ebb8b650a6

If you happen to be one of the 40 people who have posted their location in the "TRS-80 Model 100 Users - Google Maps" at the Club 100 website, then the coordinates of your location already exist as a DATA statement within an auxiliary MERGE file MRG900.DO that is provided in order to simplify the preparation.  You may MERGE the entire file to cover all 40 people if you wish, or you may reduce the size of the MERGE file so that it contains only the DATA statement for your location.  The DATA statements are in alphabetic order by last name: beginning with Steve Adolph (line 901) and ending with Garrett Withrow (line 940).  Note that if you do not prepare Sun Compass by supplying your location DATA, then by default the location DATA is for Ron Wiesen (line 939).

Sun Compass considers each of the various time zones around the world to be a specific "Time Zone displacement" quantity relative to the Prime Meridian where the time kept in that zone is known as Universal Time Coordinated (UTC).  You specify your displacement as a quantity of whole or fractional hours relative to UTC.  The range of the Time Zone displacement is from -12.0 hours to +12.0 hours.  For example, -6.0 hours from the Prime Meridian is the displacement of the following places: Central time zone of U.S. and Canada, Belize, Costa Rica, Easter Is., Galapagos Is., Guatemala, Honduras, Monterray/Mexico City/Cancun area of Mexico, Nicaragua, San Salvador, and Saskatchewan Canada  Another example is +6.0 hours from the Prime Meridian, which is the displacement of the following places: Eastern Kazakhstan, Bangladesh, Bhutan, British Indian Ocean Territory, and Omsk/Novosibirsk area of Russia.  If you are not certain about the displacement for the particular time zone that you use as the reference of the time-of-day clock in your laptop, an auxiliary MERGE file MRG700.DO is provided which contains DATA statements that cover well over 150 regions of the world.  You may MERGE the entire file if you wish, or you may reduce the size of the MERGE file so that it contains only the DATA statement for the Time Zone displacement that is the reference of the time-of-day clock in your laptop.  The DATA statements are in order that begins with 0 hours for UTC at the Prime Meridian, becomes progressively more negative for regions in the Westward direction through to -12.0 hours and transits (at regions near the International Date Line) to +12.0 hours, and then becomes progressively less positive for the remaining regions of the world which are situated in the Eastern direction from the Prime Meridian.  Note that if you do not prepare Sun Compass by supplying the reference of the time-of-day clock in your laptop, then by default the Time Zone displacement is 0 for UTC.  Note that many Radio Amateurs, for the sake of simplicity and standardization, reference the time-of-day clock in their laptops to UTC+0.

Gnomon to Cast a Shadow

Sun Compass presents the rotating shadow-line throughout all spans of time when it is possible for the Sun to be seen above the horizon at your Earth location.  Situated outdoors in direct sunlight, Sun Compass need only one thing: a gnomon to cast a shadow!  You can employ many everyday objects to serve as a gnomon.  For example, a standard business card is 2" high by 3-1/2" wide.  When it is carefully folded lengthwise, the business card becomes a gnomon that stands 3-1/2" high.  Another example is the ever-present AA cell which becomes a 2" high gnomon when stood upright on its negative terminal end.  Any object that has a straight edge that can be made to stand perfectly vertical upon the LCD glass of the laptop is a suitable gnomon with which to cast a shadow on the surface of the LCD glass.

A glass test tube, stood upright on its open end, makes an excellent gnomon.  Because the glass of the test tube only partially blocks the sunlight, it casts a "soft" shadow which in most situations is visually better for alignment with the rotating shadow-line than is the case for alignment with a "hard" shadow cast by an opaque gnomon.

A glass test tube with its open end set upon the LCD glass panel makes for an interesting gnomon.  Although the sunlight is radially refracted in passing through the curved surface of the glass, it passes through two curved surfaces of opposing influence and consequently the emerging sunlight at the "shadow side" of the test tube is not radially displaced by refraction!  Suppliers of glass test tubes are:

•	Lake Charles Mfg, URL [ http://www.testtubesonline.com/product_p/206-0045w.htm ]
•	American Science & Surplus, URL [ http://www.sciplus.com/category.cfm/subsection/4 ]

Rather than a glass test tube, using an acrylic tube as a gnomon has certain advantages.  The greatest advantage in using acrylic tubing is that it comes in stock length, rather than in a specific length such as for glass test tubes.  Consequently, you can cut a piece that is exactly the optimum length in relation to the highest Sun altitude that occurs at your latitude (except of course for the band of latitudes near the Equator that range between +23° 26' and -23° 26' where the Sun altitude reaches 90° during some parts of the year).  Another advantage of acrylic tubes versus glass test tubes is that an acrylic tube creates a greater visual contrast due its lower visible light transmittance (92%) which casts a darker shadow on the LCD glass that is more easily seen.  One supplier of extruded acrylic tube stock is:

•	Ridout Plastics, URL [ http://www.eplastics.com/Plastic/Extruded-Plexiglass-Acrylic-Tubing ]

Suitable candidates for use as tubular gnomons, available from the aforementioned suppliers, are listed in the table below.  As far as mechanical stability is concerned, the greater the width/height ratio of an object, the greater is its mechanical stability.  Tubes with a width/length  ratio of 0.125:1 or greater are considered to have good mechanical stability when stood upright on one end.

+--------+--------+--------------+---------------+------------------+--------+
| Tube   | Tube   | Width/Length | Altitude for  | Item Number, and | Price  |
| Width  | Length | Ratio        | 15/16" Shadow | Supplier Name    |        |
+--------+--------+--------------+---------------+------------------+--------+
|  9.5mm | cut to | depends upon | depends upon  | ACREXT.375X.125  | $3.43  |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|   3/8" | E.g.,  | Example:     | Example:      +------------------+--------+
| 0.375" | 2.953" | 0.12666667:1 |  72.38535670° | ACREXT.375X.250  | $2.03  |
|        |   75mm |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+
| 10.0mm |   75mm | 0.13333333:1 |  72.38535670° | 206-0011S        | $0.22  |
|        |        |              |               | Lake Charles Mfg | each   |
+--------+--------+--------------+---------------+------------------+--------+
| 12.0mm |   75mm | 0.16000000:1 |  72.38535670° | 206-0001S        | $0.24  |
|        |        |              |               | Lake Charles Mfg | each   |
+--------+--------+--------------+---------------+------------------+--------+
| 12.7mm | cut to | depends upon | depends upon  | ACREXT.500X.187  | $8.12  |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|   1/2" | E.g.,  | Example:     | Example:      +------------------+--------+
| 0.500" | 3.937" | 0.12700000:1 |  76.60588851° | ACREXT.500X.250  | $5.03  |
|        |  100mm |              |               | Ridout Plastics  | 6-foot |
|        |        |              |               +------------------+--------+
|        |        |              |               | ACREXT.500X.375  | $2.97  |
|        |        |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+
| 13.0mm |  100mm | 0.13000000:1 |  76.60588851° | 206-0002S        | $0.26  |
|        |        |              |               | Lake Charles Mfg | each   |
|        |        |              |               +------------------+--------+
|        |        |              |               | 88995            | $3.50  |
|        |        |              |               | American Science | 8-pack |
|        |        |              |               | & Surplus        |        |
+--------+--------+--------------+---------------+------------------+--------+
| 15.0mm |   85mm | 0.17647059:1 |  74.34994056° | 206-0045         | $88.50 |
|        |        |              |               | Lake Charles Mfg | 1000   |
+--------+--------+--------------+---------------+------------------+--------+
| 15.9mm | cut to | depends upon | depends upon  | ACREXT.625X.375  | $6.75  |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|   5/8" | E.g.,  | Example:     | Example:      +------------------+--------+
| 0.625" | 5.906" | 0.10600000:1 |  80.97956869° | ACREXT.625X.500  | $3.78  |
|        |  150mm |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+
| 16.0mm |  100mm | 0.16000000:1 |  76.60588851° | 206-0003S        | $0.30  |
|        |        |              |               | Lake Charles Mfg | each   |
+--------+--------+--------------+---------------+------------------+--------+
| 16.0mm |  125mm | 0.12800000:1 |  79.21438571° | 206-0005S        | $0.34  |
|        |        |              |               | Lake Charles Mfg | each   |
+--------+--------+--------------+---------------+------------------+--------+
| 16.0mm |  150mm | 0.10666667:1 |  80.97956869° | 206-0006S        | $0.38  |
|        |        |              |               | Lake Charles Mfg | each   |
|        |        |              |               +------------------+--------+
|        |        |              |               | 88996            | $3.25  |
|        |        |              |               | American Science | 5-pack |
|        |        |              |               | & Surplus        |        |
+--------+--------+--------------+---------------+------------------+--------+
| 18.0mm |  150mm | 0.12000000:1 |  80.97956869° | 206-0007S        | $0.44  |
|        |        |              |               | Lake Charles Mfg | each   |
+--------+--------+--------------+---------------+------------------+--------+
| 19.1mm | cut to | depends upon | depends upon  | ACREXT.750X.500  | $6.75  |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|   3/4" | E.g.,  | Example:     | Example:      +------------------+--------+
| 0.750" | 5.906" | 0.12733333:1 |  80.97956869° | ACREXT.750X.625  | $4.66  |
|        |  150mm |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+
| 20.0mm |  150mm | 0.13333333:1 |  80.97956869° | 206-0008S        | $0.48  |
|        |        |              |               | Lake Charles Mfg | each   |
|        |        |              |               +------------------+--------+
|        |        |              |               | 88997            | $3.50  |
|        |        |              |               | American Science | 3-pack |
|        |        |              |               | & Surplus        |        |
+--------+--------+--------------+---------------+------------------+--------+
| 22.2mm | cut to | depends upon | depends upon  | ACREXT.875X.625  | $10.18 |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|   7/8" | E.g.,  | Example:     | Example:      +------------------+--------+
| 0.875" | 5.906" | 0.14800000:1 |  80.97956869° | ACREXT.875X.750  | $5.49  |
|        |  150mm |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+
| 25.0mm |  150mm | 0.16666667:1 |  80.97956869° | 92614            | $5.25  |
|        |        |              |               | American Science | 3-pack |
|        |        |              |               | & Surplus        |        |
+--------+--------+--------------+---------------+------------------+--------+
| 25.4mm | cut to | depends upon | depends upon  | ACREXT1.000X.750 | $9.47  |
|        | length | cut length   | cut length    | Ridout Plastics  | 6-foot |
|     1" | E.g.,  | Example:     | Example:      +------------------+--------+
| 1.000" | 5.906" | 0.16933333:1 |  80.97956869° | ACREXT1.000X.875 | $6.32  |
|        |  150mm |              |               | Ridout Plastics  | 6-foot |
+--------+--------+--------------+---------------+------------------+--------+

Keep the LCD Glass Surface Level

The Tandy Model 100/102 laptop has its LCD glass surface slightly tilted in relation to its base.  So if you place the laptop on a perfectly level surface, its LCD glass surface will not be perfectly level and consequently a gnomon set upon the LCD glass surface will not stand perfectly upright.  The angular difference between the LCD glass surface and the base of the laptop is nearly 2.386°.

It is important for the sake of accuracy to hold the laptop in an attitude where the LCD glass surface is perfectly level.  A very practical way to assure this is to place a small, circular, centered-bubble level on the upper part of the laptop.  Although you can place the level on the LCD glass surface, it is less obscuring and much more practical to place the level on top of the rectangular badge which is directly to the right of the LCD.  A suitably small centered-bubble level, called the "Bull's-Eye Level", is sold by Ace Hardware as item number 24539 at a cost of $3.99.

If you plan to use Sun Compass with a laptop sitting on a flat surface that is known to be perfectly level, you can use fourteen U.S. 1-cent pennies as shims under the base of the laptop.  The pennies are arranged in three stacks: two stacks of 3 pennies each, and one stack of 8 pennies.  Make up the stacks using glue to hold the pennies of each stack together, and let the glue dry overnight.  Then use some tape to affix the penny stacks to the bottom base of the laptop at the positions shown in the illustration below.

Sun Compass Files

Three textual files are supplied with Sun Compass.  These are:
•	SNCMPS.DO -- 12.7 kByte volume; the main program
•	MRG700.DO -- 4.8 kByte volume; an auxiliary MERGE file used to prepare Sun Compass for usage
•	MRG900.DO -- 2.8 kByte volume; an auxiliary MERGE file used to prepare Sun Compass for usage

Enter BASIC, and type the NEW command in order to purge any program statements from the NoName BASIC file.  Then use the MERGE"SNCMPS.DO" command -- the WAIT message flashes for more than 1 minute while the BASIC interpreter tokenizes the program statements.  When Ok appears, type the KILL"SNCMPS.DO" command in order to free the volume of memory that it occupies.

Taking a Test Drive

At this point, if you wish, you may take Sun Compass for a test drive.  It has not been prepared for your specific usage (Latitude & Longitude of your location on Earth, and Time Zone displacement), but the default state of Sun Compass is sufficient for becoming familiar with its operation.  Type the RUN command to begin operation of Sun Compass.

Observe the left-hand panel where Sun Compass presents textual information that is updated at every 10-second interval.  The 6th line shows the Latitude & Longitude coordinates of the Earth location, which is the unvarying information that does not change during updates.  If the time-of-day and Earth location are such that the Sun is above the horizon, then the Sun Altitude seen at the 4th line will show a positive value, the rotating shadow-line will appear in the right-hand panel, and a beep will be issued upon update at every 10-second interval.  But if the time-of-day and Earth location are such that the Sun is below the horizon, then the Sun Altitude will show a negative value and no shadow-line will appear nor will any beep be issued.

The bottommost line (i.e., 8th line) of the left-hand panel presents four commands, each with its particular command letter keystrike shown between [ ] brackets.  Initially this line appears as shown below.

[Q]uiet [G]nomon [U]TC± [E]nd

You can suppress the beeps that are issued upon updates by striking the Q key, so that the laptop remains quiet and does not make any sound.  Once you strike the Q key, the bottommost line changes and appears as shown below.

[S]ound [G]nomon [U]TC± [E]nd

If you strike the S key, the laptop sounds beeps once again and the bottommost line reverts to its former presentation.  In other words, the Q keystrike and the S keystrike are toggles.

Now make a G keystrike.  Explanatory text appears in the left-hand panel while a large crosshair target appears in the right-hand panel.  This persists for over 20 seconds, and then the LCD reverts to its former presentation.  This is a sufficient time for you to place a gnomon on the LCD glass, and center it directly on the large crosshair target.

Now make a U keystrike.  The Time Zone displacement is reported in the left-hand panel, and the shadow-line remains visible in the right-hand panel.  Notice that the text in the left-hand panel mentions how the Time Zone displacement can be changed, and it shows filename MRG700.DO.  This persists for over 20 seconds, and then the LCD reverts to its former presentation.

Use the E keystrike to end program interpretation.  This places the LCD in its ordinary 40-column wide, scrolling mode.  But if you use the BREAK key or the CTRL-C key combination, the LCD will be left in the 29-column wide, non-scrolling, mode that Sun Compass employs.  Albeit well suited to Sun Compass usage, this mode is awkward to use for other purposes, such as LISTing the program.

Accuracy in Azimuth

When it comes to accuracy, Sun Compass is exceptional!  Its report of Sun Azimuth, and its rotating shadow-line, are extremely accurate with worst-case angular errors of no more than ±18 arc minutes.  The typical error in most cases is no more than ±6 arc minutes.  Sun Compass easily surpasses the mediocre accuracy of a magnetic compass.  The accuracy of any magnetic compass suffers due to the changing magnetic field of the Earth; the "Magnetic Declination" in North America, circa 1990, is illustrated below.

Note that you can use Sun Compass to determine the current Magnetic Declination at any Earth location where sunshine is available.  If you enjoy participation in "orienteering" exercises and contests, take your laptop along and use Sun Compass before you embark.  Rather than adjust your magnetic compass compensation via published data on maps, which are out of date, Sun Compass affords you an up-to-date determination of Magnetic Declination anywhere, at any time, as long as the Sun shines.

You can verify the accuracy of Sun Compass by comparing its results to those of the U.S. Naval Observatory.  See URL below.

http://aa.usno.navy.mil/data/docs/AltAz.php

As is true for results from the U.S. Naval Observatory, Sun Compass applies compensation to its report of Sun Altitude in order to account for the effects of atmospheric refraction.  For true Sun elevations of 85° or greater (i.e., near directly overhead) Sun Compass does not apply any compensation because refraction is trivial at such high Sun elevations.  Below true Sun elevations of 85°, Sun Compass approximates the average conditions (barometric pressure, height above sea level, air temperatures, etc.) that influence atmospheric refraction.  The compensation, as applied by Sun Compass, is shown by the graph below.

The vertical line in the chart above identifies the case where the true altitude of the Sun is exactly 0° (i.e., directly on the local horizon).  In this case nearly a half of a degree of compensation is applied by Sun Compass.  Notice that Sun Compass applies more than half of a degree of compensation for cases where the true elevation of the Sun is slightly negative (i.e., the Sun is below the local horizon).  Nevertheless, the compensation is in accordance with the actual nature of atmospheric refraction in that the "visual Sun elevation" is slightly positive as viewed at ground level.