Planet Ephemeris 2068 is a planetary position calculator that computes the ecliptic longitude, latitude, right ascension, and declination of the Sun, Moon, and eight planets (Mercury through Pluto) for any date between 1700 and 2201. The program accepts date, time, time zone, and geographic longitude as inputs, then calculates the Julian Day Number, Greenwich and Local Sidereal Times, and orbital elements using Keplerian mechanics with perturbation corrections. For eccentricities greater than 0.1 it solves Kepler’s equation iteratively using a Newton-Raphson-style numerical method (lines 2770–2920), while lower eccentricities use a direct series expansion. Output can be directed to either the screen or a printer, with coordinates displayed in degrees and arc-minutes alongside zodiac sign positions.
Program Analysis
Program Structure
The program is organized into a clear set of functional blocks separated by line number ranges:
- Lines 1–9: Definitions (user functions, startup beeps, POKE, and jump to title screen)
- Lines 120–160: String table initialization (zodiac signs, month names, day names, two-digit number lookup)
- Lines 170–490: Input handling for date, time, time zone, and longitude
- Lines 500–540: Output device selection (screen or printer)
- Lines 590–790: Julian Day Number, Greenwich Sidereal Time, and Local Sidereal Time computation
- Lines 800–980: Subroutines for parsing dot-delimited date strings and computing Julian Day Number
- Lines 990–1096: General-purpose HH.MM parser with AM/PM and compass-direction suffix handling
- Lines 1100–1290: Sun orbital elements and heliocentric position in ecliptic coordinates
- Lines 1400–1495: Output header block, channel opening, and array dimensioning
- Lines 1500–2480: Moon (with full perturbation series) and planetary position loops for Mercury through Pluto
- Lines 2500–2692: Planet-to-equatorial coordinate conversion subroutine
- Lines 2700–2930: Kepler equation solver (series expansion and iterative Newton-Raphson)
- Lines 2940–3000: Formatted output subroutine per body
- Lines 4100–4200: Title screen with border drawing
- Lines 4350–4800: Repeat/termination logic, UDG data loader, and SAVE
- Line 9900: STOP
Input Parsing
The subroutine at lines 800–910 parses the date string by scanning for period characters, storing their positions in array L(10), then extracting month, day, and year using VAL on substrings. Years entered as two digits are silently promoted to the 1900s at line 900. Validation at lines 222–226 rejects months outside 1–12, days outside 1–31, and years outside 1700–2201, with descending BEEP tones as error feedback.
The general time/angle parser at lines 990–1096 handles HH.MM format with optional AM/PM suffix and optional directional suffix (N, S, E, W). It scans backward through the input string to strip these suffixes before extracting numeric values, allowing the same subroutine to parse both time and geographic longitude inputs.
Julian Day and Sidereal Time
The Julian Day Number is calculated at line 410 as F+2342031+(H-12)/24, where F is a modified integer day count computed in the subroutine at lines 920–980. That subroutine uses the standard algorithm separating months January/February from the rest, and includes corrections at lines 960–970 for the Gregorian/Julian calendar boundary and for years near the epoch. Greenwich Nominal Sidereal Time (GNST) is computed at line 600 using the formula (F*6.57098350E-2+22.55066429)/24 and then converted to hours, minutes, seconds via the subroutine at lines 640–690. Local Sidereal Time at line 700 adds the hour angle correction and a small rate correction 2.74E-3*D.
Orbital Mechanics
Each planet’s position is computed from Keplerian orbital elements (mean longitude L, argument of perihelion W, longitude of ascending node O, eccentricity E, inclination I, and semi-major axis A) defined as linear functions of time T in Julian centuries from J1900.0. The Kepler equation solver at lines 2700–2930 branches on eccentricity: for E <= 0.1 a four-term trigonometric series gives the true anomaly directly; for higher eccentricities (relevant for Pluto), a Newton-Raphson iteration (lines 2790–2900) is applied using VAL of the string "M-X+E*SIN X" as a live expression evaluator to compute the Kepler equation residual.
Heliocentric ecliptic rectangular coordinates are rotated to geocentric equatorial coordinates in the subroutine at lines 2590–2640. The obliquity of the ecliptic B is computed at line 1290 as 0.40931975-0.00022711*T (approximately 23.45° decreasing with time). Right ascension and declination are extracted using ATN with quadrant correction via conditional additions of PI or 2*PI.
Moon Perturbations
The Moon’s position (lines 1550–1665) uses a substantially more complex model than the planets, computing ecliptic longitude Z with 21 perturbation terms (lines 1640–1642) and latitude LAT with 11 perturbation terms (line 1646). The terms involve combinations of the Moon’s mean longitude L, the node O, the mean anomaly E, the Sun’s mean anomaly I, and the argument of latitude W, reflecting the well-known complexity of lunar theory.
Output Formatting
The program uses the pre-built two-digit string N$ at line 150 as a lookup table for zero-padded integer formatting — a common technique to avoid conditional logic for leading zeros. Positions are displayed in degrees and arc-minutes alongside the zodiac sign (from S$) and sign degree. The subroutine at lines 2940–3000 assembles each line of output for both screen and printer using PRINT #4, with the channel opened as "s" (screen) or "p" (printer) depending on the user’s selection at line 520. The degree symbol is represented using the block graphic escape \' (▘), which on this system renders as the degree indicator in this context.
User-Defined Functions
| Function | Purpose |
|---|---|
FN C(X) | Reduces angle X (in radians) to degrees in the range 0–360, preserving sign |
FN A(X) | Reduces angle X to the range 0–K (0–2π), preserving sign |
FN A$(L) | Returns “N”, “S”, or ” ” depending on the sign of latitude/declination L |
Notable Techniques
- The string
N$(line 150) encodes all two-digit numbers 00–60 as a lookup table, accessed withN$(2*n+1 TO 2*n+2)throughout the program for zero-padded display. VAL Q$at lines 2790–2900 evaluates the string"M-X+E*SIN X"as a BASIC expression at runtime, making the Kepler residual function dynamically computed without a dedicated subroutine.- UDG characters A and B are loaded from DATA at line 4900 via the subroutine at line 4800, defining custom glyphs used in the title screen display. The startup path at line 9 bypasses this loader; it is only invoked if re-entering via line 4700 (which is the SAVE autorun target).
- Output is abstracted via stream
#4, opened to either"s"or"p", so all subsequentPRINT #4statements work unchanged for both screen and printer output. - The variable name collision between the loop variable
Z$in the DIM statement (line 160, a string array) and the scalar numeric variableZused throughout the orbital mechanics code is resolved by BASIC’s type system — the arrayZ$and the numericZare distinct. - At line 1460,
z$(7)uses a lowercasez, which on this system is treated as a separate variable from the arrayZ$, and would likely cause a variable-not-found or empty-string result — a probable typo forZ$(7). - The variable
D$defined as the day-name string at line 140 is overwritten at line 330 with the time zone input, andMused for month is reused for minutes throughout, requiring careful ordering of computations.
Content
Source Code
1 REM Planet Ephemeris 2068
2 REM \* 1985 I. Auersbacher
3 DEF FN C(X)=SGN (X)*360*(ABS X/K-INT (ABS X/K))
4 DEF FN A(X)=SGN (X)*K*(ABS X/K-INT (ABS X/K))
5 DEF FN A$(L)=("N" AND L>0)+("S" AND L<0)+(" " AND L=0)
8 BEEP .05,25: BEEP .05,25
9 POKE 23658,8: GO TO 4100
120 LET S$="ArTaGeCaLeViLiScSaCpAqPi "
130 LET M$="JAN.FEB.MAR.APR.MAY JUN.JUL.AUG.SEP.OCT.NOV.DEC."
140 LET D$="SUNDAY MONDAY TUESDAY WEDNESDAYTHURSDAY FRIDAY SATURDAY "
150 LET N$="00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960"
160 DIM Z$(9,40): POKE 23658,8
170 PRINT PAPER 7;AT 7,1;"DATE (MM.DD.YYYY):";
180 BEEP 0.04,15: INPUT PAPER 7;"DATE:"; LINE Q$
190 IF Q$="" THEN GO TO 180
200 LET Z$(1)=Q$
220 GO SUB 800
222 IF M<1 OR M>12 THEN BEEP 0.5,-15: BEEP 0.6,-20: GO TO 180
224 IF D<1 OR D>31 THEN BEEP 0.5,-15: BEEP 0.6,-20: GO TO 180
226 IF Y<1700 OR Y>2201 THEN BEEP 1.0,-20: GO TO 180
230 GO SUB 920
235 PRINT PAPER 6;Q$
240 LET S=F-(7*INT (F/7))+1
245 PRINT PAPER 7;AT 8,1;"DATE: ";M$(4*M-3 TO 4*M);D;",";Y;" ";D$(9*S-8 TO 9*S)
250 LET Z$(2)="DATE: "+M$(4*M-3 TO 4*M)+STR$ D+","+STR$ Y+" "+D$(9*S-8 TO 9*S)
260 PRINT PAPER 7;AT 9,1;"TIME (HH.MM): ";
270 BEEP 0.04,15: INPUT PAPER 7;"TIME: "; LINE Q$
275 IF Q$="" THEN GO TO 270
280 PRINT PAPER 6;" ";Q$;" "
300 LET Z$(3)="TIME:"+Q$
310 GO SUB 990
320 PRINT PAPER 7;AT 10,1;"TIME ZONE = ";
330 BEEP 0.04,15: INPUT PAPER 7;"ZONE: "; LINE D$
340 PRINT PAPER 6;" ";D$;" "
360 LET Z$(4)="ZONE:"+D$
370 IF D$(1)="+" THEN LET D$=D$(2 TO )
372 LET Q$=Q$(LEN Q$-1 TO LEN Q$)
374 IF Q$="PM" THEN LET H=H+12
376 IF Q$="PM" AND H=24 THEN LET H=12
378 IF Q$="AM" AND H=12 THEN LET H=0
380 LET H=H+M/60+VAL D$
400 LET D=H-12
410 LET JD=F+2342031+(H-12)/24
420 PRINT PAPER 7;AT 11,1;"LONGITUDE = ";
430 BEEP 0.04,15: INPUT PAPER 7;"LONG: "; LINE Q$
435 IF Q$="" THEN GO TO 430
440 PRINT PAPER 6;Q$
460 LET Z$(5)="LONG:"+Q$
470 GO SUB 990
480 LET LN=H+M/60
490 IF Q$(LEN Q$)="E" THEN LET LN=-LN
500 PRINT PAPER 6;AT 13,4;"Output to which device? "
505 PRINT PAPER 7;AT 15,9;"1-TV Screen ";AT 16,9;"2-TS Printer"
510 PAUSE 30: PRINT PAPER 6;AT 18,4;"Please pick option (1-2)"
515 BEEP 0.04,15
520 LET q$=INKEY$: IF q$="" THEN GO TO 520
530 LET C=CODE q$-48: IF (C<1)+(C>2) THEN BEEP 0.5,-15: BEEP 0.6,-20: GO TO 520
540 BEEP .05,22: PRINT INK 0;AT 14+C,6;CHR$ 144; INK 6;CHR$ 145
590 LET Z$(6)="Julian Day Number ="+STR$ JD
600 LET S=(F*6.57098350E-2+22.55066429)/24
610 GO SUB 640
620 LET Z$(7)="GNST="+N$(2*H+1 TO 2*H+2)+":"+N$(2*MN+1 TO 2*MN+2)+":"+N$(2*SC+1 TO 2*SC+2)
630 GO TO 700
640 LET S=24*(S-INT S)
650 LET H=INT S
660 LET M=60*(S-H)
670 LET MN=INT M
680 LET SC=INT (60*(M-MN))
690 RETURN
700 LET S=S+D+2.74E-3*D-4*LN/60
710 IF S<0 THEN LET S=S+24
720 IF S<=24 THEN GO TO 750
730 LET S=S-24
740 GO TO 720
750 GO SUB 650
760 LET Q$=N$(2*H+1 TO 2*H+2)+"h"+N$(2*MN+1 TO 2*MN+2)+"m"+N$(2*SC+1 TO 2*SC+2)
780 LET Z$(8)="Local Sidereal Time="+Q$+"s"
790 GO TO 1100
800 DIM L(10)
810 LET L=1
820 FOR Z=1 TO LEN Q$
830 IF Q$(Z)<>"." THEN GO TO 860
840 LET L(L)=Z
850 LET L=L+1
860 NEXT Z
870 LET M=VAL Q$( TO L(1)-1)
880 LET D=VAL Q$(L(1)+1 TO L(2)-1)
890 LET Y=VAL Q$(L(2)+1 TO )
900 IF Y<100 THEN LET Y=Y+1900
910 RETURN
920 IF M>2 THEN GO TO 950
930 LET F=INT (30.6*(M+13))+INT (365.25*(Y-1))+D-621049
940 GO TO 960
950 LET F=INT (30.6*(M+1))+INT (365.25*Y)+D-621049
960 IF F>146097 THEN LET F=F-1
970 IF F<=73047 THEN LET F=F+(F<=73047)+(F<=36522)
980 RETURN
990 LET L=0
995 FOR Z=1 TO LEN Q$
1000 IF Q$(Z)<>"." THEN GO TO 1030
1010 LET L=Z
1020 LET Z=LEN Q$
1030 NEXT Z
1040 LET Z=Z-1
1050 IF Q$(Z-1 TO Z)="AM" OR Q$(Z-1 TO Z)="PM" THEN LET Z=Z-2
1060 IF Q$(Z)="E" OR Q$(Z)="W" OR Q$(Z)="N" OR Q$(Z)="S" THEN LET Z=Z-1
1065 IF L=0 THEN GO TO 1092
1070 LET H=VAL Q$( TO L-1)
1080 LET M=VAL Q$(L+1 TO Z)
1090 RETURN
1092 LET H=VAL Q$( TO Z)
1094 LET M=0
1096 RETURN
1100 LET T=(JD-2415020)/36525
1110 LET L=1.740035281+628.3319508*T+5.279620987E-6*T*T
1120 LET K=2*PI
1130 LET L=K*(L/K-INT (L/K))
1140 LET W=1.766636813+3.000526417E-2*T+7.902463002E-6*T*T
1150 LET E=0.01675104-0.0000418*T-0.000000126*T*T
1160 LET M=L-W
1170 GO SUB 2700
1180 LET L=L+(V-M)+PI
1190 GO SUB 2640
1200 LET L(1)=L
1210 LET P$="SuMoMeVeMaJuSaUrNePl ": LET P=1
1260 LET R=1.00000013*(1-E*E)/(1+E*COS V)
1270 LET XE=R*COS (W+V)
1280 LET YE=R*SIN (W+V)
1290 LET B=.40931975-.00022711*T
1400 IF C=1 THEN OPEN #4,"s": PAPER 7: CLS : GO TO 1450
1410 OPEN #4,"p": PRINT FLASH 1; PAPER 7;AT 20,4;" See printer for output "
1450 PRINT #4;" SUN, MOON & PLANET COORDINATES ": PRINT #4
1455 PRINT #4;Z$(2, TO 38)
1458 PRINT #4;Z$(3, TO 22);TAB 15;Z$(4, TO 20)
1460 PRINT #4;Z$(5, TO 22);TAB 15;z$(7, TO 22): PRINT #4
1465 PRINT #4;Z$(6)( TO 40)
1470 PRINT #4;Z$(8)( TO 40)
1480 PRINT #4: PRINT #4;" LONG. LAT. R.A. DECL."
1490 PRINT #4;"\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''"
1495 LET P=0: DIM T(10): DIM R(10): DIM D(10): LET L=L(1)
1500 GO SUB 2650: LET LAT=0: LET X=-XE: LET Y=-YE: LET Z=0
1505 GO SUB 2593: LET T(1)=LAT: LET R(1)=RA: LET D(1)=DEC
1510 LET P=1
1540 DIM E$(10,6): GO SUB 2940
1550 LET L=4.719966570+8399.709144*T-1.978039819E-5*T*T
1560 LET L=K*(L/K-INT (L/K))
1570 LET W=4.908229466+3.000526417E-2*T+7.902463002E-6*T*T
1580 LET O=5.835151532+71.01804125*T-1.802052453E-4*T*T
1590 LET O=K*(O/K-INT (O/K))
1600 LET E=4.523601515-33.75714624*T+3.626406335E-5*T*T
1610 LET E=K*(E/K-INT (E/K))
1620 LET I=6.121523943+7771.377194*T-2.506486731E-5*T*T
1630 LET I=K*(I/K-INT (I/K))
1640 LET Z=L+1.097597812E-1*SIN (L-O)-2.22356789E-2*SIN (L-O-2*I)+1.148959458E-2*SIN (2*I)+3.728319019E-3*SIN (2*L-2*O)-3.243132031E-3*SIN (L-I-W)-1.995560985E-3*SIN (2*L-2*E)-1.026146941E-3*SIN (2*(L-O-I))-9.997779E-4*SIN (2*L-O-W-3*I)+9.3061925E-4*SIN (L-O+2*I)
1642 LET Z=Z-8.016442699E-4*SIN (L-W-3*I)+7.169327754E-4*SIN (I+W-O)-6.04974752E-4*SIN I-5.323448144E-4*SIN (2*L-O-I-W)-2.674911004E-4*SIN (2*(L-E-O))-2.186509702E-4*SIN (3*L-2*E-O)+1.916565444E-4*SIN (2*E-L-O)-1.863042014E-4*SIN (L-O-4*I)+1.751340942E-4*SIN (3*L-3*O)-1.491917141E-4*SIN (2*(L-O-2*I))-1.382252286E-4*SIN (W-O-I)-1.185417932E-4*SIN (L-W+I)
1646 LET LAT=8.950378078E-2*SIN (L-E)+4.897490844E-3*SIN (2*L-O-E)-4.846658129E-3*SIN (O-E)-3.023579307E-3*SIN (L-E-2*I)+9.671305718E-4*SIN (2*I+O-E)-8.075880856E-4*SIN (2*L-O-E-2*I)+5.685022187E-4*SIN (L-E+2*I)+3.001626944E-4*SIN (3*L-2*O-E)-1.617289959E-4*SIN (O-E-2*I)-1.539913695E-4*SIN (2*O-L-E)-1.439363338E-4*SIN (2*L-3*I-W-E)
1650 LET L=FN A(Z): LET X=COS LAT*COS L: LET Y=COS LAT*SIN L
1660 LET Z=SIN LAT: GO SUB 2640
1665 LET L(2)=L: GO SUB 2593: LET T(2)=LAT: LET R(2)=RA: LET P=2
1670 LET D(2)=DEC: GO SUB 2940
1690 LET L=3.109811566+2608.814681*T
1700 LET W=1.324699618+2.714840259E-2*T
1710 LET O=0.8228519594+2.068578774E-2*T
1720 LET E=0.20561421+2.046E-5*T
1730 LET I=0.1222233228+3.24776685E-5*T
1740 LET A=0.3870984
1750 GO SUB 2500
1760 LET L(3)=L: LET T(3)=LAT: LET R(3)=RA: LET D(3)=DEC:
1770 LET P=3: GO SUB 2940
1790 LET L=5.982413639+1021.352923*T
1800 LET W=2.271787458+2.457486613E-2*T
1810 LET O=1.32260435+1.570534527E-2*T
1820 LET E=0.00682069-4.774E-5*T
1830 LET I=0.0592300268+1.755510339E-5*T
1840 LET A=0.72333015
1850 GO SUB 2500
1860 LET L(4)=L: LET T(4)=LAT: LET R(4)=RA: LET D(4)=DEC
1870 LET P=4: GO SUB 2940
1890 LET L=5.126863275+334.0856765*T
1900 LET W=5.833208059+3.212729365E-2*T
1910 LET O=0.8514840375+1.345634309E-2*T
1920 LET E=0.09331290+9.206E-5*T
1930 LET I=0.03229440892-1.178097245E-5*T
1940 LET A=1.52368839
1950 GO SUB 2500
1960 LET L(5)=L: LET T(5)=LAT: LET R(5)=RA: LET D(5)=DEC
1980 LET P=5: GO SUB 2940
1990 LET L=4.156824261+52.99346669*T
2000 LET W=.2220220737+0.02809913191*T
2010 LET O=1.735614507+0.01763707569*T
2020 LET E=0.04833475+1.642E-4*T
2030 LET I=2.284175418E-2-9.941589345E-5*T
2040 LET A=5.202561
2050 GO SUB 2500
2060 LET L(6)=L: LET T(6)=LAT: LET R(6)=RA: LET D(6)=DEC
2080 LET P=6: GO SUB 2940
2090 LET L=4.643990303+21.3542759*T
2100 LET W=1.589962854+0.03418080441*T
2110 LET O=1.968563651+0.01524013019*T
2120 LET E=0.05589232-3.455E-4*T
2130 LET I=.04350267097-6.839751413E-5*T
2140 LET A=9.554747
2150 GO SUB 2500
2160 LET L(7)=L: LET T(7)=LAT: LET R(7)=RA: LET D(7)=DEC
2180 LET P=7: GO SUB 2940
2190 LET L=4.246476159+7.502534209*T
2200 LET W=2.99408877+2.59082395E-2*T
2210 LET O=1.282417271+8.703394596E-3*T
2220 LET E=0.0463444-2.658E-5*T
2230 LET I=0.01348203821+1.091315596E-5*T
2240 LET A=19.21814
2250 GO SUB 2500
2260 LET L(8)=L: LET T(8)=LAT: LET R(8)=RA: LET D(8)=DEC
2280 LET P=8: GO SUB 2940
2290 LET L=1.482505841+3.837733181*T
2300 LET W=0.8155456719+2.48635145E-2*T
2310 LET O=2.280819973+1.918003402E-2*T
2320 LET E=0.00899704+6.330E-6*T
2330 LET I=3.105362528E-2-1.665674364E-4*T
2340 LET A=30.10957
2350 GO SUB 2500
2360 LET L(9)=L: LET T(9)=LAT: LET R(9)=RA: LET D(9)=DEC
2380 LET P=9: GO SUB 2940
2390 LET L=7.89626153+2.557238*T
2400 LET W=3.882990161+2.762099317E-2*T
2410 LET O=1.901399262+0.0239794161*T
2420 LET E=0.248003807+0.0028868311*T
2430 LET I=0.299267728-2.22206250E-4*T
2440 LET A=39.517738
2450 GO SUB 2500
2460 LET L(10)=L: LET T(10)=LAT: LET R(10)=RA: LET D(10)=DEC
2480 LET P=10: GO SUB 2940
2485 IF C=2 THEN LPRINT : LPRINT : LPRINT : LPRINT
2490 GO TO 4350
2500 LET L=K*(L/K-INT (L/K))
2510 LET W=K*(W/K-INT (W/K))
2520 LET M=L-W
2530 GO SUB 2700
2540 LET R=A*(1-E*E)/(1+E*COS V)
2550 LET C1=COS O
2560 LET C2=COS (W-O+V)
2570 LET C3=SIN O
2580 LET C4=SIN (W-O+V)
2590 LET X=R*(C1*C2-C3*C4*COS I)-XE
2591 LET Y=R*(C2*C3+C1*C4*COS I)-YE
2592 LET Z=R*C4*SIN I: LET LAT=ATN (Z/SQR (X*X+Y*Y))
2593 LET LAT=FN C(LAT): LET LD=INT ABS (LAT): LET LM=INT (60*(ABS LAT-LD))
2594 LET Y1=Y*COS B-Z*SIN B
2595 LET Z1=Y*SIN B+Z*COS B
2596 LET RA=ATN (Y1/X): IF X<0 THEN LET RA=RA+PI
2597 IF (X>0)*(Y1<0) THEN LET RA=RA+2*PI
2598 LET RA=FN C(RA): LET RD=INT RA: LET RM=INT (60*(RA-RD))
2600 LET DEC=ATN (Z1/SQR (X*X+Y1*Y1)): LET DEC=FN C(DEC)
2602 LET DD=INT ABS (DEC): LET DM=INT (60*(ABS DEC-DD))
2604 IF P<2 THEN RETURN
2610 LET L=ATN (Y/X)
2620 IF (X<0) THEN LET L=L+PI
2630 IF (X>0)*(Y<0) THEN LET L=L+2*PI
2640 LET L=360*(L/K-INT (L/K))
2650 LET D=L/30
2660 LET SI=INT D+1
2670 LET D=INT (30*(D-INT D))
2680 LET MN=INT (60*(L-INT L))
2690 RETURN
2700 IF E>0.1 THEN GO TO 2770
2710 LET C1=2*E-E*E*E/4
2720 LET C2=E*E*(5/4-11*E*E/24)
2730 LET C3=13*E*E*E/12
2740 LET C4=103*E*E*E*E/96
2750 LET V=M+C1*SIN M+C2*SIN (2*M)+C3*SIN (3*M)+C4*SIN (4*M)
2760 RETURN
2770 LET Q$="M-X+E*SIN X"
2780 LET Y=PI/2
2790 LET V=Y/1E5: LET X=Y: LET U=X: LET F=VAL Q$: LET Z=F
2800 LET X=Y+V: LET F=VAL Q$
2860 LET Q=F
2870 IF Z=0 THEN GO TO 2920
2890 LET Y=Y-V/(Q/Z-1): IF ABS (Y-U)<0.00001 THEN GO TO 2920
2900 GO TO 2790
2920 LET V=2*ATN (SQR ((1+E)/(1-E))*TAN (X/2))
2930 RETURN
2940 LET Q$=""+P$(2*P-1 TO 2*P)+""
2950 LET D$=N$(2*D+1 TO 2*D+2)
2960 LET A$=""+S$(2*SI-1 TO 2*SI)+""
2970 PRINT #4;Q$;D$;A$;N$(2*MN+1 TO 2*MN+2);" ";N$(2*LD+1 TO 2*LD+2);"\' ";N$(2*LM+1 TO 2*LM+2);FN A$(LAT);" ";" "( TO 3-LEN STR$ RD);STR$ RD;"\' ";N$(2*RM+1 TO 2*RM+2);" ";N$(2*DD+1 TO 2*DD+2);"\' ";N$(2*DM+1 TO 2*DM+2);FN A$(DEC): LET E$(P)=Q$+D$+A$
3000 RETURN
4100 BORDER 5: PAPER 3: CLS
4150 PRINT PAPER 6;AT 1,3;"\:'\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\':";AT 2,3;"\: Planetary - Ephemeris \ :";AT 3,3;"\: \ :";AT 4,3;"\: \* 1985 I. Auersbacher \ :";AT 5,3;"\:.\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.:"
4155 PLOT 0,0: DRAW 0,175: DRAW 255,0: DRAW 0,-175: DRAW -255,0
4200 GO TO 120
4350 BEEP 0.05,22: BEEP 0.05,22
4500 PRINT #0; PAPER 7;" Another chart? (Y/N):"
4550 LET Q$=INKEY$
4560 IF Q$="" THEN GO TO 4550
4570 IF Q$="Y" THEN GO TO 8
4600 PAPER 7: CLS : BORDER 7: PRINT FLASH 1;AT 10,6;" PROGRAM TERMINATED ": GO TO 9900
4700 BEEP 0.05,22: BEEP 0.05,20
4800 RESTORE 4900: FOR T=0 TO 7: READ K,L: POKE USR "A"+T,K: POKE USR "B"+T,L: NEXT T: POKE 23609,10: GO TO 4100
4900 DATA 0,24,0,48,127,96,127,255,127,255,115,248,115,248,127,240
5000 SAVE "ephemeris" LINE 4700
9900 STOP
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

