"23:59:59"0:TS$ݪ:DS$ݫ:DS$(DS$,6)"20"(DS$,2):Avoid last second of a day; capture Time & Date strings; formulate 21st century Date string~PI#:500:If Pi is defined then pass through to next line, elsewise Pi is not defined (i.e., resolved as zero) because initial assignment of constants and variables has not been made -- go make those initial assignmentsƁYR%((DS$,4)):LY%1(YR%400):0LY%LY%(YR%100)(1(YR%4))MN%((DS$,2)):DY%365((DS$,4)):(LY%MN%)2DY%DY%1013MN%16,15,14,13,12,11,10,9,8,7,6,5fDY%DY%31:reduce by 365;enter here for JanuaryDY%DY%28:reduce by 334;enter here for FebruaryтDY%DY%31:reduce by 306;enter here for MarchDY%DY%30:reduce by 275;enter here for April7 DY%DY%31:reduce by 245;enter here for Mayj
DY%DY%30:reduce by 214;enter here for JuneDY%DY%31:reduce by 184;enter here for July҃DY%DY%31:reduce by 153;enter here for August
DY%DY%30:reduce by 122;enter here for September@DY%DY%31:reduce by 092;enter here for OctoberwDY%DY%30:reduce by 061;enter here for NovemberDY%DY%31:reduce by 031;enter here for DecemberބT0#2PI#DY%(365LY%):Temporal factor 0T1#T0#4.8718:Temporal factor 1SD#0.32200322.9711(T0#)0.357898(2T0#)0.14398(3T0#)3.94638(T0#)0.019334(2T0#)0.05928(3T0#):Solar Declination (in degrees)مSD#SD#DR#:Solar Declination expression now in radiansv(ET#5.0323430.837(T1#)12.5024(2T1#)18.25(3T1#)100.976(T1#)595.275(2T1#)3.6858(3T1#)12.47(4T1#):Equation of Time (in seconds)2LA#LT#DR#:LAtitude (in radians)9TD!TZ!:Time Differential (in hours) with respect to Universal Time Coordinated (UTC)E:12TD!TD!TD!24:compensate (only once) if more negative than -12;TD!12TD!TD!24:compensate (only once) if more positive than +12<UC#TD!((TS$,2))((TS$,4))60((TS$,2))3600:Universal time-of-day Coordinated (in hours)EUC#24UC#UC#24:1(UC#)UC#UC#24:compensate (once only) if +24 or more positive, else compensate (once only) if -24 or less negative͈FHA#LG#PI#12(ET#3600UC#)PI#:Hour Angle (in radians)@P:Calculation of AL# follows. Sine of AL# is computed, and then its ArcSine (i.e., inverse sine) produces AL#QSL#(SD#)(LA#)(SD#)(LA#)(HA#):Sine of aLtitude angle of sun[X:ArcSine (i.e., ArcSIN) is not provided in Tandy BASIC. ArcSine is found via BASIC equivalent statements where the ArcSine of unitless number, such as UN#, is equal to ATN ( UN# / SQR( 1 - UN# * UN#) )YAL#(SL#(1SL#2)):ALtitude angle of sun, which is the true angle rather than the visible angle that results from atmospheric refraction (in radians)sZ:Calculation of AZ# follows. Cosine of AZ# is computed, and then its ArcCosine (i.e., inverse Cosine) produces AZ#[CZ#((SD#)(LA#)(SD#)(LA#)(HA#))(AL#):Cosine of AZ#V\:To avoid the FC Error in the subsequent SQR() function, the value of CZ# must not exceed positive 1 (or apparent threshold of 1.00000000000004999..999)]:A guard may be placed here to: adjust the CZ# value to 1.0 in all cases of excess, or allow trivial excess to trigger an Error response.J^: IF CZ# > 1 THEN CZ# = 1 'Adjust to 1.0 in all cases_: IF CZ# > 1 THEN IF CZ# <= 1+1/3D13 THEN CZ# = CZ# ELSE ERROR 17 'CN Can't Continue`: IF CZ# > 1 THEN IF CZ# <= 1+1/3D13 THEN CZ# = CZ# ELSE ERROR 50 'IE Internal Error\a: IF CZ# > 1 THEN IF CZ# <= 1+1/3D13 THEN CZ# = CZ# ELSE ERROR 255'UE Undefined Error?b:ArcCosine (i.e., ArcCOS) is not provided in Tandy BASIC. ArcCosine is found via BASIC equivalent statements where the ArcCosine of a unitless number, such as UN#, is equal to -ATN ( UN# / SQR( 1 - UN# * UN#) ) + PI# / 2cAZ#(CZ#(1CZ#2))PI#2:Calculate AZimuth angle of sun (in radians)ݏd(HA#)1AZ#2PI#AZ#:Compensate Azimuth due to a positive hour anglen@0,"Date \ \ Time \ \";DS$,TS$;Vo"Equation of Time +##min ##sec";ET#6060,(ET#60(ET#6060));p"Sun Declined +##.###########"(166);SD#RD#;q301:"Sun Altitude +##.###########"(166);RL#;r"Sun Azimuth"(149)" ###.###########"(166);AZ#RD#;As"Lt+##.######"(166)" Lng+###.######"(166);LT#,LG#RD#;vt"Hour Angle +###.###########"(166);HA#RD#;x290:Display command line(XO%,YO%),0:erase prior shadow-line,(RL#)0250:atmospheric refraction compensated (i.e., optic) altitude of sun is below the horizonkY%YO%R%(AZ#):(XO%R%(AZ#),Y%),1:draw shadow-lineS%ͱ:If sound is allowed, beep to notify that shadow-line has changed(65450)0͊(,7)(TS$,7)250:0:K$:Stay here until operator makes a keystrike or a new 10-second interval commences. Go back upon new interval for update; capture keystrike and proceed forward.V%((1("QqGgUuEeSs",K$))2):V%0Ͳ11838,50:250:If not valid keystrike then loop back6V%1920,5:V%254,258,255,280,253:5-way branch based on valid keystrikeQS%1:290:250:SoundlS%0:290:250:QuietՔ@0,;:Y%1(2501):((2500));::@0,;:Equivalent CLS for any screen width; reuses variable Y%x"Time zone displacement with":"respect to Universal Time":"Coordinated (UTC) is +##.##";TZ!:"hours. This can be changed":"by editing line 540, where a""RESTORE7nn phrase points to":"a line of DATA in the range":"of 701 through 797. MRG700.DO";:260:250:UTC+/--:(XO%,YO%R%)(XO%,YO%R%):(XO%R%,YO%)(XO%R%,YO%),1"Center the gnomon exactly on the crosshair target that is seen in right-hand panel. It must stand perfectly upright on the LCD glass. During use the laptop must be placed so that the LCD glass is level.";:260::5945Y%032766:::Dwell a short time409:411::Enable scroll, set screen width to 40-column, and end program interpretationؗ":Subroutine to display appropriate line of command keystrikes/#408:@7(2500),;:Disable scrool, set print position to bottommost line of LCDV$S%ͣ"[Q]uiet ";::"[S]ound ";:~%"[G]nomon [U]TC"(141)" [E]nd";:+,:Subroutine to determine the visual sun altitude based on average conditions of atmospheric refractionJ-RL#AL#RD#:Refracted aLtitude (in degrees) is based on true ALtitude angle of sun.RL#85309:No compensation for 85 degrees < true sun altitude/TR#(RL#DR#):Tangent of Refracted altitudeE0RL#05RL#RL#(58.1TR#0.07TR#30.000086TR#5)3600:309:Compensation for 05 degrees < true sun altitude <= 85 degrees1RL#0.575RL#RL#(1735518.2RL#103.4RL#212.79RL#30.722RL#4)3600:309:Compensation for -0.575 degrees < true sun altitude <= 05 degrees2TR#0RL#7.0000000000001E64:To avoid the ?/0 Error in the subsequent TAN() function, if the value of RL# is 0 then it must be adjusted to be as small as possible above the value of 03RL#RL#(20.774TR#)3600:Compensation for true sun altitude <= -0.575 degreesD5:Atmospheric refraction compensated ALtitude angle of sun (in degrees)p:Subroutines for LCD control purposesڜ(27)"U";:Disengage LABEL line of screen, then pass to next program line for subroutine completionO408:@0,;:Y%1(2501):((2500));::@0,;:409::Equivalent CLS for any screen width; reuses variable Y%(27)"V";::Disable scrool, cursor position unchangedȝ(27)"W";::Enable scroll, cursor position unchanged(XO%,YO%)::reset the shadow-line origin pixel, which registers originF2500,40::Set screen width to 40-columnv2500,29::Set screen width to 29-columnT:Abort if not M10x laptop, elsewise retain variables TS$ & DS$, but make initial assignment for constants and other variables in a forced order (using dummy values if necessary) for sake of high-speed interpretation(72)ͱ:"This program is valid for Model 100 and Model 102 laptops only."::_PI#2(3D13):Forced order assignment. Constant Pi approximation for all laptop Models (100/102/200) based on value of 3D13 being a sufficiently close approximation to infinityŠDR#PI#180:Forced order assignment. Constant Degrees-to-Radians angular unit conversion factor+RD#180PI#:Forced order assignment. Constant Radians-to-Degrees angular unit conversion factorYR%0:LY%0:Forced order assignment by dummy value. Variables YeaR number & LeapYear_flagMN%0:DY%0:Forced order assignment by dummy value. Variables MoNth number & Day-of-Year number[T0#0:T1#0:Forced order assignment by dummy value. Variables Temporal_factor_0 & Temporal_factor_1TD!0:Forced order assignment by dummy value. Constant Time_Differential UC#0:Forced order assignment by dummy value. Variable Universal_time-of-day_CoordinatedXSD#0:Forced order assignment by dummy value. Variable Solar DeclinationLA#0:Forced order assignment by dummy value. Variable LAtitude of location (in radians)
LG#0:Forced order assignment by dummy value. Constant LonGitude of location_HA#0:Forced order assignment by dummy value. Variable Hour Angle (in radians)ǤSL#0:Forced order assignment by dummy value. Variable Sine of aLtitude angle of sun (in radians)'AL#0:Forced order assignment by dummy value. Variable ALtitude angle of sun (in radians)}CZ#0:Forced order assignment by dummy value. Variable Cosine of aZimuth of sunɥAZ#0:Forced order assignment by dummy value. Variable AZimuth of sun3RL#0:Forced order assignment by dummy value. Variable Refracted aLtitude angle of sun (in degrees)TR#0:Forced order assignment by dummy value. Variable Tangent of Refracted altitudeܦXO%2081:YO%31:Forced order assignment. Constants X-Origin & Y-Origin" R%YO%1:Forced order assignment. Constant Radius maximum limit
Y%0:Forced order assignment by dummy value. Variable Y ordinate, and also reused for general purposesET#0:Forced order assignment by dummy value. Variable Equation of Time (in seconds)ILT#0:Forced order assignment by dummy value. Constant LaTitude of location (in degrees)701:TZ!:Forced order assignment by default value. Constant Time Zone displacement&939:LT#:LG#:LG#LG#DR#:LaTitude (in degrees) & LonGitude (in radians) coordinates of locationR0K$"":Forced order assignment by dummy value. Variable Keystrike1V%0:Forced order assignment by dummy value. Variable Valid keystrike2S%1:Forced order assignment of default value. Variable Sound: 0=quiet, not0=sound is allowed.%R411:40-column screen widthwS406:Disengage LABEL line of screen, disable scroll, perform equivalent CLST@29,(152):@69," ":@109,"N":@149,"o":@189,"r":@229,"t":@269,"h":(174,56)(179,63),0,BF:(176,6)(176,15),1:place vertical North pointer on screenmU410:(XO%,YO%),0:register shadow-line origin, nul for the initial shadow-lineV412:29-column screen widthW2:Forced order of constants & variables is established, and constant PI# has aquired the value of PiX:Laptop-specific datumY -2.3859440304::LCD screen Angle of Tilt in Tandy M10x laptop as measured by Ron Wiesen (in degrees)w:List of Time Zone displacements. In line 540, change the RESTORE line number so it points to the appropriate line in following list. Displacement is +/- whole or fractional hours relative to the Prime Meridian. Range is -12.0 to +12.0.l 0::UTC, Burkina Faso, Canary Is., Cote D' Ivoire, Faroe Is., Gambia, Ghana, Guinea, Guinea Bissau, Iceland, Ireland, Isle of Man, Liberia, Mali, Mauritania, Madeira Is., Morocco, Portugal, Senegal, Shetland Is., Sierra Leone, Togo, U.K.-:List of LaTitude (in degrees) & LonGitude (in degrees) coordinates for various folks. In line 550, change the RESTORE line number so it points to the appropriate line in following list.q +28.398600,-080.748465::coordinates for Ron Wiesen [WD8PNL]