Category : Science and Education
Archive   : PLANETS.ZIP
Filename : PLANETS1.3TP

 
Output of file : PLANETS1.3TP contained in archive : PLANETS.ZIP

CONST
DegreesInRadian = 57.295779513;
PiDividedByTwo = 1.570796327;
D = 6; {Decinal places in real printouts}
Num_of_major_planets = 9;
Num_of_minor_planets = 6;
Num_of_planets = 15;
CenterX = 300;
CenterY = 92;
Scale_for_inner_planets = 52;
Scale_for_middle_planets = 15;
Scale_for_outer_planets = 2;

Display_Degrees_in_decimal : Boolean = False;
Daylight_Savings_Correction_Enabled : Boolean = True;
Display_Hour_Angle_in_Degrees : Boolean = False;
Display_RA_in_Degrees : Boolean = False;
Display_Names_on_Plots : Boolean = False;
Zone_correction : Integer = 6;
Longitude : Real = 88.3;
Latitude : Real = 43.1;
Zero : Real = 0;
Screen_Aspect : Real = 2.7;
MenuNumber : Integer = 1;
NumberOfMenus : Integer = 3;
MenuOnScreen : Boolean = True;
ColorMonitor : Boolean = False;
StopTime = 8;
TimeSpeed : Integer = StopTime;
SlowestTime = 2;
FastestTime = 14;
TravelMode : Boolean = False;
Sun_ecliptic_longitude_at_epoch = 278.83354;
Sun_ecliptic_longitude_of_perigee = 282.596403;
Sun_Ecc = 0.016718;
Sun_Epoch = 1980;
Sun_Angular_Diameter = 0.533128;
Moon_mean_longitude_at_epoch = 64.975464;
Moon_longitude_of_perigee_at_epoch = 349.383063;
Moon_longitude_of_node_at_epoch = 151.950429;
Moon_Inc = 5.145396;
Moon_Ecc = 0.0549;
Moon_Angular_Diameter = 0.5181;
Moon_Axis = 384401.0;
Moon_Epoch = 0;

P1 : ARRAY[0..7] OF Byte = ($7E, $99, $99, $99, $9D, $99, $81,
$7E);
P2 : ARRAY[0..7] OF Byte = ($7E, $BD, $89, $91, $A5, $99, $81,
$7E);
P3 : ARRAY[0..7] OF Byte = ($7E, $BD, $A1, $B9, $A1, $BD, $81,
$7E);
P4 : ARRAY[0..7] OF Byte = ($7E, $91, $BD, $95, $99, $91, $81,
$7E);
P5 : ARRAY[0..7] OF Byte = ($7E, $BD, $A1, $BD, $85, $BD, $81,
$7E);
P6 : ARRAY[0..7] OF Byte = ($7E, $BD, $A5, $BD, $85, $BD, $81,
$7E);
P7 : ARRAY[0..7] OF Byte = ($7E, $A1, $A1, $A1, $A1, $BD, $81,
$7E);
P8 : ARRAY[0..7] OF Byte = ($7E, $BD, $A5, $BD, $A5, $BD, $81,
$7E);
P9 : ARRAY[0..7] OF Byte = ($7E, $BD, $A1, $BD, $A5, $BD, $81,
$7E);
P0 : ARRAY[0..7] OF Byte = ($C3, $66, $3C, $3C, $3C, $3C, $66,
$C3);
P10 : ARRAY[0..7] OF Byte = ($00, $3C, $24, $10, $08, $24, $3C,
$00);
P11 : ARRAY[0..7] OF Byte = ($00, $42, $42, $42, $5A, $66, $42,
$00);


{ constants added by A. McG. }

SkyWindowColor : Integer = 1;
PlanetColor : Integer = 1;
BIOSSEG : Integer = $f000; { ROM BIOS segment }
IDOFFSET: Integer = $fffe; { hardware id offset }
IBM_PC: Byte = $ff; { system is standard PC }
PC_XT: Byte = $fe;
PC_JR: Byte = $fd; { system is a Junior }
PC_AT: Byte = $fc;
PC_XTNEW: Byte = $fb; { newer version of XT }
PC_5560: Byte = $e1;
PC_5550: Byte = $e0; { system is 5540 or 5550 }
EGASEG: Integer = $0040; { if EGA is present, this }
EGAOFFSET: Integer = $0087; { location is nonzero }

TYPE
orbit =
RECORD
name : STRING[10];
radius : real;
rotation : real;
Epoch : Real;
Perihelion_Epoch : Real;
Period : Real;
Long_at_Epoch : Real;
Long_of_Per : Real;
Ecc : Real;
Axis : Real;
Inc : Real;
Long_of_Ascend_Node : Real;
Size : Real;
Brightness : Real;
NumberOfMoons : integer;
END;
moondata =
RECORD
name : STRING[10];
Radius : real; {Km}
period : Real; {days}
Long_of_Per : Real;
axis : Real; {X 1000 Km}
Ecc : Real;
Inc : Real;
END;
MSDOS_REGISTERS =
RECORD
AX, BX, CX, DX, BP, SI, DI, DS, ES, FLAGS : Integer;
END;

VAR
SaveSetUpFile : Text;
OrbitFile : Text;
ExitLoop, ok, overwriting : Boolean;
MSDOS_time : MSDOS_REGISTERS;
ch, ch1, LastCommand : Char;
planets : ARRAY[1..num_of_planets] OF orbit;
moons : ARRAY[1..19,1..15] OF moondata;
num, PlanetSelected, MinorPlanetSelected : Integer;
start_moon_selected, last_moon_selected : Integer;
day, month, year, day_of_year : Integer;
earth_day : real;
JD : Real;
Hardware : Byte;
EGA_present : Boolean;

planet_long_of_ascend_node : Real;
planet_mean_anomaly : Real;
planet_heliocentric_long : Real;
planet_true_anomaly : Real;
planet_radius_vector : Real;
planet_helio_ecliptic_lat : Real;

earth_long_of_ascend_node : Real;
earth_mean_anomaly : Real;
earth_heliocentric_long : Real;
earth_true_anomaly : Real;
earth_radius_vector : Real;

Sun_mean_anomaly : Real;
Sun_true_anomaly : Real;
Sun_longitude : Real;
Sun_RA : Real;
Sun_DEC : Real;
Sun_Altitude : Real;
Sun_Azimuth : Real;
Sun_Hour_Angle : Real;
Sun_Size : Real;
Sun_LST_Rise : Real;
Sun_LST_Set : Real;
Sun_LCT_Rise : Real;
Sun_LCT_Set : Real;
Sun_Azimuth_Set : Real;
Sun_Azimuth_Rise : Real;

Moon_mean_longitude : Real;
Moon_true_longitude : Real;
Moon_mean_anomaly : Real;
Moon_true_anomaly : Real;
Moon_long : Real;
Moon_radius_vector : Real;
Moon_ascending_node_mean_longitude : Real;
Moon_corrected_anomaly : Real;
Moon_correction_for_equation_of_centre : Real;
Moon_ecliptic_latitude : Real;
Moon_ecliptic_longitude : Real;
Moon_RA : Real;
Moon_DEC : Real;
Moon_Altitude : Real;
Moon_Azimuth : Real;
Moon_Hour_Angle : Real;
Moon_Size : Real;
Moon_Distance : Real;
Moon_Age : Real;
Moon_Position_Angle : Real;
Moon_LST_Rise : Real;
Moon_LST_Set : Real;
Moon_LCT_Rise : Real;
Moon_LCT_Set : Real;
Moon_Azimuth_Set : Real;
Moon_Azimuth_Rise : Real;

GMT : Real; {Greenwich mean time}
GST : Real; {Greenwich Siderial time}
LCT : Real; {Local Civil time}
Lst : Real; {Local Siderial time}

Hour : Integer;
Minute : Integer;
T, B : Real;

projected_heliocentric_long : Real;
projected_radius_vector : Real;

Geocentric_ecliptic_Long : Real;
Geocentric_latitude : Real;


RA : Real; {equatorial coordinates}
DEC : Real;

Phase : Real;
Distance_from_Earth1 : Real;
Distance_from_Earth2 : Real;
Distance_from_Earth : Real;
Diameter : Real;
Magnitude : Real;

Hour_Angle : Real;
Hour_Angle_in_Degrees : Real;
Azimuth : Real;
Altitude : Real;

LST_Rise : Real;
LST_Set : Real;
LCT_Rise : Real;
LCT_Set : Real;
Azimuth_Set : Real;
Azimuth_Rise : Real;

y : Real; {intermediate variable}
x : Real; {intermediate variable}
z : Real; {intermediate variable}
Daylight_savings_start : Real;
Daylight_savings_end : Real;
OldXpos, OldYpos : ARRAY[1..Num_Of_Planets] OF Integer;
SymbolBuffer : ARRAY[1..Num_Of_Planets] OF ARRAY[1..30] OF Byte;
i,n : Integer;
last_scale_selected : Integer;

{ Get Hardware Id and EGA flag - A. McG. }

procedure get_hardware(var Hardware_Id: Byte; var EGA_present: Boolean);
var val: Byte;
begin
Hardware_Id := Mem[BIOSSEG:IDOFFSET];
val := Mem[EGASEG:EGAOFFSET];
if (val = 0) then EGA_present := false
else EGA_present := true;
end;


{ Trig Functions }


FUNCTION DEGREE(X : Real) : Real;
BEGIN
DEGREE := X * DegreesInRadian
END; {DEGREE}

FUNCTION RADIAN(X : Real) : Real;
BEGIN
RADIAN := X / DegreesInRadian
END; {RADIAN}

FUNCTION SIND(X : Real) : Real;
BEGIN
SIND := Sin(X / DegreesInRadian)
END; {SIND}

FUNCTION COSD(X : Real) : Real;
BEGIN
COSD := Cos(X / DegreesInRadian)
END; {COSD}

FUNCTION TAN(X : Real) : Real;
BEGIN
TAN := Sin(X) / Cos(X)
END; {TAN}

FUNCTION TAND(X : Real) : Real;
BEGIN
TAND := TAN(X / DegreesInRadian)
END; {TAND}

FUNCTION ARCTAND(X : Real) : Real;
BEGIN
ARCTAND := DegreesInRadian * ArcTan(X)
END; {ARCTAND}

FUNCTION ARCTANYX(Y, X : Real) : Real;
VAR
z, zmax : Real;
BEGIN
z := ArcTanD(y / x);
IF (y > 0) AND (x > 0) THEN zmax := 90;
IF (y > 0) AND (x < 0) THEN zmax := 180;
IF (y < 0) AND (x < 0) THEN zmax := 270;
IF (y < 0) AND (x > 0) THEN zmax := 360;
WHILE z > zmax DO z := z - 180;
WHILE z < (zmax - 90) DO z := Z + 180;
ARCTANYX := z;
END; {ARCTANYX}

FUNCTION ARCSIN(X : Real) : Real;
BEGIN
IF X * X >= 1 THEN ARCSIN := PiDividedByTwo ELSE
ARCSIN := ArcTan(X / Sqrt(1 - X * X))
END; {ARCSIN}

FUNCTION ARCSIND(X : Real) : Real;
BEGIN
ARCSIND := DegreesInRadian * ARCSIN(X)
END; {ARCSIND}

FUNCTION ARCCOS(X : Real) : Real;
BEGIN
IF X * X >= 1 THEN ARCCOS := 1 ELSE
ARCCOS := PiDividedByTwo - ArcTan(X / Sqrt(1 - X * X))
END; {ARCCOS}

FUNCTION ARCCOSD(X : Real) : Real;
BEGIN
ARCCOSD := DegreesInRadian * ARCCOS(X)
END;


PROCEDURE Frame(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY :
Integer);
VAR
i : Integer;
BEGIN
IF ColorMonitor
THEN
TextColor(Yellow)
ELSE
TextColor(White);
GoToXY(UpperLeftX, UpperLeftY); Write('Ú');
FOR i := UpperLeftX + 1 TO LowerRightX - 1 DO Write('Ä');
Write('¿');
FOR i := UpperLeftY + 1 TO LowerRightY - 1 DO
BEGIN
GoToXY(UpperLeftX, i); Write('³');
GoToXY(LowerRightX, i); Write('³');
END;
GoToXY(UpperLeftX, LowerRightY);
Write('À');
FOR i := UpperLeftX + 1 TO LowerRightX - 1 DO Write('Ä');
Write('Ù');
TextColor(White);
END { Frame } ;


{ Astronomy Functions }


FUNCTION Minutes(time : Real) : Integer;
BEGIN
Minutes := Abs(Trunc(60 * (Frac(time))))
END;

FUNCTION Seconds(time : Real) : Integer;
BEGIN
Seconds := Abs(Trunc(60 * (Frac(60 * Frac(time)))))
END;

PROCEDURE deg_min_sec(VAR angle : Real);
BEGIN
IF NOT Display_Degrees_in_Decimal
THEN
BEGIN
IF angle < 0 THEN Write('-') ELSE Write(' ');
Write(Abs(Trunc(angle)):3, 'ø ', minutes(angle):2, ''' ',
seconds(angle):2, '"');
END
ELSE
Write(angle:8:4, 'ø ');
END;

PROCEDURE hours_min_sec(VAR angle : Real);
BEGIN
IF NOT Display_Degrees_in_Decimal
THEN
BEGIN
IF angle < 0 THEN Write('-') ELSE Write(' ');
Write(Abs(Trunc(angle / 15)):3, 'h ', minutes(angle / 15):2, 'm '
,
seconds(angle / 15):2, 's');
END
ELSE
Write(angle / 15:8:4, 'h');
END;

FUNCTION Daylight_Savings : Boolean;
BEGIN
Daylight_Savings := (((Month + Day / 100) < Daylight_savings_end) AND
((Month + Day / 100) > Daylight_savings_start) AND
Daylight_savings_Correction_Enabled);
END;

FUNCTION Anomaly(M, Ecc : Real) : Real;
VAR
d : Real;
E : Real;
BEGIN
E := M;
d := E - Ecc * Sin(E) - M;
WHILE Abs(d) > 0.000001 DO
BEGIN
E := E - d / (1 - Ecc * Cos(E));
d := E - Ecc * Sin(E) - M
END;
Anomaly := 2 * ArcTan(Sqrt((1 + Ecc) / (1 - Ecc)) * Tan(E / 2))
END; {Anomaly}

FUNCTION JulianDay(month, day, year : Integer) : Real;
VAR
A, B, C, D : Real;

BEGIN
IF (month = 1) OR (month = 2)
THEN
BEGIN
year := year - 1;
month := month + 12
END;
IF (year > 1582) OR (year = 1582) AND (month > 10) OR (year =
1582) AND (month = 10) AND (day > 15)
THEN
BEGIN
A := Int(year / 100);
B := 2 - A + Int(A / 4)
END
ELSE
BEGIN
B := 0
END;

C := Int(365.25 * year);
D := Int(30.6001 * (month + 1));
JulianDay := B + C + D + day + 1720994.5;
END; {JulianDay}

FUNCTION ECL_TO_RA(L, B : Real) : Real;
VAR
x : Real;
y : Real;
z : Real;
BEGIN
x := COSD(L);
y := SIND(L) * 0.91746406 - TAND(B) * 0.397818676;
z := ArcTanYX(y, x);
ECL_TO_RA := Z;
END; {ECL_TO_RA}

FUNCTION ECL_TO_DEC(L, B : Real) : Real;
BEGIN
ECL_TO_DEC := ARCSIND(SIND(B) * 0.91746406 + COSD(B) * SIND(L)
* 0.397818676);
END;

FUNCTION LST_TO_LCT(Lst, Long : Real;
Year, Day_of_year : Integer;
Zone_Corr : Real) : Real;
VAR
B, T, GST, GMT : Real;
BEGIN
GST := Lst + Long / 15;
IF GST > 24 THEN GST := GST - 24;
IF GST < 0 THEN GST := GST + 24;
T := (JulianDay(1, 0, year) - 2415020.0) / 36525.0;
B := 24 - 6.6460656 - (2400.051262 * T) - (0.00002581 * T * T) +
(24 * (year - 1900));
T := GST - Day_of_Year * 0.0657098 + B;
IF T > 24 THEN T := T - 24;
IF T < 0 THEN T := T + 24;
GMT := T * 0.99727;
LST_TO_LCT := GMT - Zone_Corr;
END;

PROCEDURE make_degrees_in_range(VAR n : Real);
BEGIN
WHILE n > 36000.0 DO
n := n - 36000.0;
WHILE n > 3600 DO
n := n - 3600;
WHILE n > 360 DO
n := n - 360;
WHILE n < - 36000.0 DO
n := n + 36000.0;
WHILE n < - 3600 DO
n := n + 3600;
WHILE n < 0 DO
n := n + 360;
END;

PROCEDURE Make_Hours_in_Range(VAR n : Real);
BEGIN
WHILE n >= 24 DO
n := n - 24;
WHILE n < 0 DO
n := n + 24;
END;


PROCEDURE GoToHiRes;
BEGIN
IF NOT TravelMode {moon plot} THEN
BEGIN
HiRes;
IF ColorMonitor
THEN
if (Hardware = PC_JR) or EGA_present then
CASE LastCommand OF
'V' : HiResColor(Magenta);
'B' : HiResColor(Red);
'Z' : HiResColor(Brown);
ELSE HiResColor(Blue);
END
else (* CGA *)
CASE LastCommand OF
'V' : HiResColor(LightBlue);
'B' : HiResColor(LightMagenta);
'Z' : HiResColor(LightGreen);
ELSE HiResColor(LightCyan);
END
ELSE
HiResColor(White);
Window(1, 1, 80, 25);
END;
IF LastCommand = '@' THEN
BEGIN
GoToXY(16,1);
Write('Earth_Days = ',Earth_Day:4:2);
Write(' ',Planets[PlanetSelected].name,' days = ',
Earth_Day * Planets[3].rotation /
Planets[PlanetSelected].rotation:4:2)
END
ELSE
BEGIN
GoToXY(63, 1);
WriteLn(month, '-', day, '-', year, ' ');
GoToXY(63, 2);
WriteLn('JD =', JD:10:0, ' ');
GoToXY(63, 3);
WriteLn('LCT = ', Hour:2, 'h ', Minute:2, 'm', ' ');
GoToXY(63, 4);
Write('Long=', (Round(Longitude)):3, ' Lat=', (Round(Latitude)):2
, ' ');
END;
END;

PROCEDURE time_window;
VAR
JDay : Integer;
BEGIN
IF NOT TravelMode THEN
BEGIN
Window(58, 2, 78, 10);
ClrScr;
Window(1, 1, 80, 25);
frame(56, 1, 80, 10);
IF ColorMonitor
THEN
TextColor(LightMagenta)
ELSE
TextColor(White);
Window(58, 2, 78, 10);
GoToXY(1, 1);
WriteLn(' ', month, '-', day, '-', year);
END;
LCT := Hour + Minute / 60 + 1 / 120;
GMT := Zone_correction + LCT;
IF Daylight_Savings THEN
GMT := GMT - 1;
IF GMT > 12
THEN
JDay := Day + 1
ELSE
JDay := Day;
JD := Julianday(month, JDay, year);
daylight_savings_start :=
4 + (30 - Round(7 * Frac((Julianday(4, 30, year) + 1.5) / 7))) * 0.01;
daylight_savings_end :=
10 + (31 - Round(7 * Frac((Julianday(10, 31, year) + 1.5) / 7))) * 0.01;
IF NOT TravelMode THEN
BEGIN
WriteLn(' JD =', JD:10:0);
Write('Long = ');
deg_min_sec(Longitude);
WriteLn;
Write('Lat = ');
deg_min_sec(Latitude);
WriteLn;
END;
IF NOT TravelMode THEN
WriteLn(' LCT = ', Hour:2, 'h ', Minute:2, 'm');
Make_Hours_in_Range(GMT);
IF NOT TravelMode THEN
WriteLn(' GMT = ', Trunc(GMT):2, 'h ', minutes(GMT):2, 'm');
T := (JulianDay(1, 0, year) - 2415020.0) / 36525.0;
B := 24 - 6.6460656 - (2400.051262 * T) - (0.00002581 * T * T) +
(24 * (year - 1900));
GST := 0.0657098 * Day_of_year - B + GMT * 1.002738;
Make_Hours_in_Range(GST);
IF NOT TravelMode THEN
WriteLn(' GST = ', Trunc(GST):2, 'h ', minutes(GST):2, 'm');
Lst := GST - Longitude / 15;
Make_Hours_in_Range(Lst);
IF NOT TravelMode THEN
WriteLn(' LST = ', Trunc(Lst):2, 'h ', minutes(Lst):2, 'm');
END; {time_window}

PROCEDURE Make_Planet_Symbol(Xpos, Ypos, PlanetNumber : Integer;
clear : boolean);


BEGIN
IF (OldXpos[PlanetNumber] > 0) AND (OldYpos[PlanetNumber] > 0)
AND
(OldXpos[PlanetNumber] < 635) AND (OldYpos[PlanetNumber] < 195)
THEN
PutPic(SymbolBuffer[PlanetNumber],
OldXpos[PlanetNumber] - 4, OldYpos[PlanetNumber] + 4);
IF clear AND (OldXpos[PlanetNumber] < 634) AND
(OldYpos[PlanetNumber] < 194)
THEN
BEGIN
GraphWindow(OldXpos[PlanetNumber] - 4,
OldYpos[PlanetNumber] - 4,
OldXpos[PlanetNumber] + 4,
OldYpos[PlanetNumber] + 4);
FillScreen(0);
GraphWindow(0, 0, 639, 199);
END;
GetPic(SymbolBuffer[PlanetNumber], Xpos - 4, Ypos - 4, Xpos + 4, Ypos + 4);
OldXpos[PlanetNumber] := Xpos;
OldYpos[PlanetNumber] := Ypos;
CASE PlanetNumber OF
1 : Pattern(P1);
2 : Pattern(P2);
3 : Pattern(P3);
4 : Pattern(P4);
5 : Pattern(P5);
6 : Pattern(P6);
7 : Pattern(P7);
8 : Pattern(P8);
9 : Pattern(P9);
ELSE
IF (LastCommand = 'B') OR (Lastcommand = 'C') OR
(LastCommand = 'E') OR (Lastcommand = 'D') OR
(LastCommand = 'F')
THEN
Pattern(P0)
ELSE
IF PlanetNumber = 10
THEN
Pattern(P10) {Sun}
ELSE
Pattern(P11); {Moon}
END;
IF (Xpos < 636) AND (Ypos < 196) AND (Xpos > 3) AND (Ypos > 3)
THEN
BEGIN
GraphWindow(Xpos - 3, Ypos - 3, Xpos + 4, Ypos + 4);
FillScreen(0);
GraphWindow(0, 0, 639, 199);
FillPattern(Xpos - 3, Ypos - 3, Xpos + 4, Ypos + 4, 1);
END;
END;

PROCEDURE Locate_Position_of_Planet_in_Its_Own_Orbital_Plane(n :
Integer);
BEGIN
WITH planets[n] DO
BEGIN
IF Epoch = 0
THEN
BEGIN
planet_mean_anomaly := 360 * (year + day_of_year / 365.2422
- Perihelion_Epoch) / period; {E02}
Make_Degrees_in_Range(planet_mean_anomaly);
END
ELSE
BEGIN
planet_long_of_ascend_node := (360 / 365.2422) *
(Julianday(month, day, year)
- 365.2422 * Frac(Epoch)
- Julianday(1, 0, Trunc(Epoch))) / period;
Make_Degrees_in_Range(planet_long_of_ascend_node);
planet_mean_anomaly := planet_long_of_ascend_node +
long_at_epoch
- long_of_per;
Make_Degrees_in_Range(planet_mean_anomaly);
END;
planet_true_anomaly := DEGREE(ANOMALY(RADIAN(
planet_mean_anomaly), Ecc));
Make_Degrees_in_Range(planet_true_anomaly);
planet_heliocentric_long := planet_true_anomaly + long_of_per;
Make_Degrees_in_Range(planet_heliocentric_long);
planet_radius_vector := axis * (1 - Ecc * Ecc) / (1 + Ecc * COSD(
planet_true_anomaly));
planet_helio_ecliptic_lat := ARCSIND(SIND(
planet_heliocentric_long -
long_of_ascend_node) * SIND(Inc));
END;

END;

PROCEDURE Locate_Position_of_Earth;
BEGIN
WITH planets[3] DO
BEGIN
earth_long_of_ascend_node := (360 / 365.2422) * (Julianday(month
, day, year)
- Julianday(1, 0, Trunc(Epoch))) / period;
Make_Degrees_in_Range(earth_long_of_ascend_node);
earth_mean_anomaly := earth_long_of_ascend_node + long_at_epoch
- long_of_per;
earth_true_anomaly := DEGREE(ANOMALY(RADIAN(
earth_mean_anomaly), Ecc));

earth_heliocentric_long := earth_true_anomaly + long_of_per;
Make_Degrees_in_Range(earth_heliocentric_long);
earth_radius_vector := axis * (1 - Ecc * Ecc) / (1 + Ecc * COSD(
earth_true_anomaly));
END;
END;

PROCEDURE Project_Position_of_Planet_onto_Plane_of_ecliptic;
BEGIN
WITH planets[num] DO
BEGIN
y := SIND(planet_heliocentric_long - long_of_ascend_node) * COSD(
Inc);
x := COSD(planet_heliocentric_long - long_of_ascend_node);
z := ArcTanYX(y, x);
projected_heliocentric_long := Z + long_of_ascend_node;
Make_Degrees_in_Range(projected_heliocentric_long);
Projected_Radius_vector := planet_radius_vector *
COSD(planet_helio_ecliptic_lat);
END;
END;

PROCEDURE Calculate_Ecliptical_Coordinates;
BEGIN
IF (Planet_Radius_Vector < Earth_Radius_Vector)
THEN
Geocentric_Ecliptic_Long := Earth_Heliocentric_long + 180 +
ArcTanD(Projected_Radius_Vector * SIND(Earth_Heliocentric_long -
Projected_heliocentric_long) / (Earth_Radius_Vector -
Projected_Radius_Vector * COSD(Earth_Heliocentric_long -
Projected_heliocentric_long)))
ELSE
Geocentric_Ecliptic_Long := Projected_Heliocentric_Long +
ArcTanD(Earth_Radius_Vector * SIND(Projected_heliocentric_long -
Earth_Heliocentric_Long) / (Projected_Radius_Vector -
Earth_Radius_Vector * COSD(Projected_heliocentric_long -
Earth_Heliocentric_Long)));
Make_Degrees_in_Range(Geocentric_Ecliptic_Long);
Geocentric_latitude := ArcTanD(Projected_Radius_Vector *
TAND(planet_helio_ecliptic_lat) *
SIND(Geocentric_Ecliptic_Long -
Projected_Heliocentric_Long) / (Earth_Radius_Vector *
SIND(Projected_Heliocentric_Long -
Earth_Heliocentric_Long)));
END;

PROCEDURE Draw_Sky_Window;
VAR
X, Y : Integer;
BEGIN
IF NOT TravelMode THEN
BEGIN
GoToHiRes;
Locate_Position_of_Earth;
Draw(50, 170, 590, 170, 1);
Draw(590, 170, 590, 35, 1);
Draw(590, 35, 50, 35, 1);
Draw(50, 35, 50, 170, 1);
FOR X := 1 TO 3 DO
FOR Y := 18 TO 85 DO
Plot((135 * X) + 50, Y * 2, 1);
FOR Y := 1 TO 9 DO
FOR X := 13 TO 147 DO
Plot(X * 4, (15 * Y) + 20, 1);
GoToXY(23, 23);
Write('E');
GoToXY(40, 23);
Write('S');
GoToXY(58, 23);
Write('W');
GoToXY(4, 22);
Write(' 0');
GoToXY(4, 16);
Write('30');
GoToXY(4, 11);
Write('60');
GoToXY(4, 5);
Write('90');
END;
END;

PROCEDURE Compute_and_Plot_Planet_in_Sky_Window;
VAR
X, Y : Integer;
BEGIN
Locate_Position_of_Planet_in_its_Own_Orbital_Plane(num);
Project_Position_of_Planet_onto_Plane_of_ecliptic;
Calculate_Ecliptical_Coordinates;
RA := ECL_TO_RA(Geocentric_Ecliptic_Long, Geocentric_Latitude);
DEC := ECL_TO_DEC(Geocentric_Ecliptic_Long, Geocentric_Latitude);
Hour_Angle := Lst - RA / 15;
IF Hour_Angle < 0 THEN Hour_Angle := Hour_Angle + 24;
Altitude := ArcSinD(SIND(Dec) * SIND(Latitude) +
COSD(Dec) * COSD(Latitude) * COSD(Hour_Angle * 15));
Azimuth := ArcCosD((SIND(Dec) - SIND(Latitude) * SIND(Altitude)) /
(COSD(Latitude) * COSD(Altitude)));
IF SIND(Hour_Angle * 15) > 0 THEN
Azimuth := 360 - Azimuth;
IF Altitude > 0
THEN
BEGIN
X := Round(Azimuth * 1.5 + 50);
Y := Round(170 - Altitude * 1.5);
Make_Planet_Symbol(X, Y, Num,true);
GoToXY((X DIV 8) + 4, (Y DIV 8) + 1);
IF Display_Names_on_Plots AND NOT TravelMode
THEN
Write(planets[num].name);
END
ELSE
BEGIN
IF (OldXpos[num] > 0) AND (OldYpos[num] > 0) AND
((LastCommand = 'V') OR (LastCommand = 'B')
OR (LastCommand = 'Z')) AND
(OldXpos[num] < 640) AND (OldYpos[num] < 195)
THEN
BEGIN
GraphWindow(OldXpos[num] - 4,
OldYpos[num] - 4,
OldXpos[num] + 5,
OldYpos[num] + 5);
FillScreen(0);
GraphWindow(0, 0, 639, 199);
END;
END;
END;



PROCEDURE plot_planet(n, scale : Integer);
VAR
Xold, Xnew, Yold, Ynew, A : Integer;
FUNCTION compute_radius_vector(n, angle : Integer) : Real;
BEGIN
compute_radius_vector := planets[n].axis *
(1 - planets[n].ecc * planets[n].ecc)
/ (1 + planets[n].ecc * COSD(angle
- planets[n].long_of_per));
END;
PROCEDURE Draw_orbit(deg : Integer);
BEGIN
Xold := Xnew;
Yold := Ynew;
IF planets[n].Inc > 90
THEN
BEGIN
Xnew := Round(compute_radius_vector(n, A * deg) * scale *
Screen_Aspect *
COSD(A * deg)) + CenterX;
Ynew := Round(compute_radius_vector(n, A * deg) * scale *
SIND(A * deg)) + CenterY;
END
ELSE
BEGIN
Xnew := Round(compute_radius_vector(n, A * deg) * scale *
Screen_Aspect *
SIND(A * deg)) + CenterX;
Ynew := Round(compute_radius_vector(n, A * deg) * scale *
COSD(A * deg)) + CenterY;
END;
IF A > 0 THEN
Draw(Xold, Yold, Xnew, Ynew, PlanetColor );
END;
BEGIN
IF NOT TravelMode THEN
BEGIN
IF planets[n].ecc > 0.3
THEN
FOR A := 0 TO 120 DO
draw_orbit(3)
ELSE
FOR A := 0 TO 30 DO
draw_orbit(12);
END;
Locate_Position_of_Planet_in_Its_Own_Orbital_Plane(n);
IF planets[n].Inc > 90
THEN
BEGIN
Ynew := Round(scale * planet_radius_vector *
SIND(planet_heliocentric_long)) + CenterY;
Xnew := Round(scale * Screen_Aspect *
planet_radius_vector *
COSD(planet_heliocentric_long)) + CenterX;
END
ELSE
BEGIN
Ynew := Round(scale * planet_radius_vector *
COSD(planet_heliocentric_long)) + CenterY;
Xnew := Round(scale * Screen_Aspect *
planet_radius_vector *
SIND(planet_heliocentric_long)) + CenterX;
END;
overwriting := false;
FOR i := 1 TO Num_Of_Planets DO
IF (ABS(OldXpos[i] - Xnew) < 9) AND (ABS(OldYpos[i] - Ynew) < 9)
AND (n <> i)
THEN overwriting := true;
Make_Planet_Symbol(Xnew, Ynew, n,overwriting); IF (Xnew <
640) AND (Xnew > 0) AND (Ynew < 200) AND (Ynew > 0) AND
(Display_Names_on_Plots) AND (NOT TravelMode) THEN BEGIN
GoToXY((Xnew DIV 8) + 2, (Ynew DIV 8) + 1);
Write(planets[n].name); END; END;

{ Orbital Data for Planets }


PROCEDURE Orbital_Data;
BEGIN
WITH planets[1] DO
BEGIN
name := 'Mercury';
radius := 2439;
rotation := 58.646;
Epoch := 1980;
Period := 0.24085;
Long_at_Epoch := 231.2973;
Long_of_Per := 77.1442128;
Ecc := 0.2056306;
Axis := 0.3870986;
Inc := 7.0043579;
Long_of_Ascend_Node := 48.0941733;
Size := 6.74;
Brightness := 0.000001918;
NumberOfMoons := 0;
END;
WITH planets[2] DO
BEGIN
name := 'Venus';
radius := 6052;
rotation := -243.0;
Epoch := 1980;
Period := 0.61521;
Long_at_Epoch := 355.73352;
Long_of_Per := 131.2895792;
Ecc := 0.0067826;
Axis := 0.7233316;
Inc := 3.3944359;
Long_of_Ascend_Node := 76.4997524;
Size := 16.92;
Brightness := 0.00001721;
NumberOfMoons := 0;
END;
WITH planets[3] DO
BEGIN
name := 'Earth';
radius := 6378;
rotation := 0.99726966;
Epoch := 1980;
Period := 1.00004;
Long_at_Epoch := 98.833540;
Long_of_Per := 102.596403;
Ecc := 0.016718;
Axis := 1.0;
Inc := 0;
Long_of_Ascend_Node := 0;
Size := 17;
Brightness := 0;
NumberOfMoons := 1;
END;
WITH planets[4] DO
BEGIN
name := 'Mars';
radius := 3397;
rotation := 1.02595675;
Epoch := 1980;
Period := 1.88089;
Long_at_Epoch := 126.30783;
Long_of_Per := 335.6908166;
Ecc := 0.0933865;
Axis := 1.5236883;
Inc := 1.8498011;
Long_of_Ascend_Node := 49.4032001;
Size := 9.36;
Brightness := 0.00000454;
NumberOfMoons := 2;
END;
WITH planets[5] DO
BEGIN
name := 'Jupiter';
radius := 71398.0;
rotation := 0.41007;
Epoch := 1980;
Period := 11.86224;
Long_at_Epoch := 146.966365;
Long_of_Per := 14.0095493;
Ecc := 0.0484658;
Axis := 5.202561;
Inc := 1.3041819;
Long_of_Ascend_Node := 100.2520175;
Size := 196.74;
Brightness := 0.0001994;
NumberOfMoons := 13;
END;
WITH planets[6] DO
BEGIN
name := 'Saturn';
radius := 60000.0;
rotation := 0.427;
Epoch := 1980;
Period := 29.4571;
Long_at_Epoch := 165.322242;
Long_of_Per := 92.6653974;
Ecc := 0.0556155;
Axis := 9.554747;
Inc := 2.4893741;
Long_of_Ascend_Node := 113.4888341;
Size := 165.60;
Brightness := 0.0001740;
NumberOfMoons := 10;
END;

WITH planets[7] DO
BEGIN
name := 'Uranus';
radius := 25400.0;
rotation := -0.65;
Epoch := 1980;
Period := 84.01247;
Long_at_Epoch := 228.0708551;
Long_of_Per := 172.7363288;
Ecc := 0.0463232;
Axis := 19.21814;
Inc := 0.7729895;
Long_of_Ascend_Node := 73.8768642;
Size := 65.80;
Brightness := 0.00007768;
NumberOfMoons := 5;
END;
WITH planets[8] DO
BEGIN
name := 'Neptune';
radius := 24300.0;
rotation := 0.77;
Epoch := 1980;
Period := 164.79558;
Long_at_Epoch := 260.3578998;
Long_of_Per := 47.8672148;
Ecc := 0.0090021;
Axis := 30.10957;
Inc := 1.7716017;
Long_of_Ascend_Node := 131.5606494;
Size := 62.20;
Brightness := 0.00007597;
NumberOfMoons := 2;
END;

WITH planets[9] DO
BEGIN
name := 'Pluto';
radius := 1700;
rotation := 6.3867;
Epoch := 1980;
Period := 250.9;
Long_at_Epoch := 209.439;
Long_of_Per := 222.972;
Ecc := 0.25387;
Axis := 39.78459;
Inc := 17.137;
Long_of_Ascend_Node := 109.941;
Size := 8.2;
Brightness := 0.000004073;
NumberOfMoons := 1;
END;
WITH planets[10] DO
BEGIN
name := 'Ceres';
Epoch := 1981.538;
radius := 380;
Period := 4.603677;
Long_at_Epoch := 156.07;
Long_of_Per := 153.99;
Ecc := 0.0775;
Axis := 2.7671;
Inc := 10.598;
Long_of_Ascend_Node := 80.09;
Size := 2;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH planets[11] DO
BEGIN
name := 'Pallas';
Epoch := 1981.538;
radius := 240;
Period := 4.616615;
Long_at_Epoch := 115.47;
Long_of_Per := 122.7;
Ecc := 0.2322;
Axis := 2.7723;
Inc := 34.807;
Long_of_Ascend_Node := 172.72;
Size := 0;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH planets[12] DO
BEGIN
name := 'Juno';
Epoch := 1981.538;
radius := 100;
Period := 4.365134;
Long_at_Epoch := 213.67;
Long_of_Per := 56.89;
Ecc := 0.2563;
Axis := 2.6707;
Inc := 13.003;
Long_of_Ascend_Node := 169.91;
Size := 0;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH planets[13] DO
BEGIN
name := 'Vesta';
Epoch := 1981.538;
radius := 240;
Period := 3.6317146;
Long_at_Epoch := 202.04;
Long_of_Per := 253.53;
Ecc := 0.0896;
Axis := 2.3621;
Inc := 7.141;
Long_of_Ascend_Node := 103.46;
Size := 0;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH planets[14] DO
BEGIN
name := 'Halley''' + 's';
Epoch := 0; { 0 indicates Perihelion Epoch is
used }
Perihelion_Epoch := 1986.112;
Period := 76.0081;
Long_of_Per := 170.0110;
Ecc := 0.9673;
Axis := 17.9435;
Inc := 162.2384;
Long_of_Ascend_Node := 58.1540;
Size := 0;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH planets[15] DO
BEGIN
name := '-----';
Epoch := 0;
Period := 0;
Long_at_Epoch := 0;
Long_of_Per := 0;
Ecc := 0;
Axis := 0;
Inc := 0;
Long_of_Ascend_Node := 0;
Size := 0;
Brightness := 0;
NumberOfMoons := 0;
END;
WITH moons[3,1] DO
BEGIN
name := 'Moon';
radius := 1738;
period := 27.321661;
Long_of_Per := 0;
axis := 384.4;
Ecc := 0.0549;
Inc := 19;
END;
WITH moons[4,1] DO
BEGIN
name := 'Phobos';
radius := 11;
period := 0.31891023;
Long_of_Per := 0;
axis := 9.378;
Ecc := 0.015;
Inc := 1;
END;
WITH moons[4,2] DO
BEGIN
name := 'Deimos';
radius := 6;
period := 1.2624407;
Long_of_Per := 180;
axis := 23.459;
Ecc := 0.0005;
Inc := 1.6;
END;
WITH moons[5,1] DO
BEGIN
name := 'Io';
radius := 1820;
period := 1.769137786;
Long_of_Per := 0;
axis := 422;
Ecc := 0.004;
Inc := 0.04;
END;
WITH moons[5,2] DO
BEGIN
name := 'Europa';
radius := 1500;
period := 3.551181041;
Long_of_Per := 0;
axis := 671;
Ecc := 0.009;
Inc := 0.47;
END;
WITH moons[5,3] DO
BEGIN
name := 'Ganymede';
radius := 2635;
period := 7.15455296;
Long_of_Per := 90;
axis := 1070;
Ecc := 0.002;
Inc := 0.21;
END;
WITH moons[5,4] DO
BEGIN
name := 'Calliste';
radius := 2500;
period := 16.6890184;
Long_of_Per := 180;
axis := 1883;
Ecc := 0.007;
Inc := 0.51;
END;
WITH moons[5,5] DO
BEGIN
name := 'Amalthea';
radius := 133;
period := 0.49817905;
Long_of_Per := 270;
axis := 181;
Ecc := 0.003;
Inc := 0.4;
END;
WITH moons[5,6] DO
BEGIN
name := 'Hilmalia';
radius := 85;
period := 250.5662;
Long_of_Per := 0;
axis := 11480;
Ecc := 0.15798;
Inc := 27.63;
END;
WITH moons[5,7] DO
BEGIN
name := 'Elara';
radius := 40;
period := 259.6528;
Long_of_Per := 60;
axis := 11740;
Ecc := 0.20719;
Inc := 24.77;
END;
WITH moons[5,8] DO
BEGIN
name := 'Pasiphae';
radius := 18;
period := -735;
Long_of_Per := 220;
axis := 23500;
Ecc := 0.378;
Inc := 145;
END;
WITH moons[5,9] DO
BEGIN
name := 'Sinope';
radius := 14;
period := -758;
Long_of_Per := 180;
axis := 23700;
Ecc := 0.275;
Inc := 153;
END;
WITH moons[5,10] DO
BEGIN
name := 'Lysithea';
radius := 12;
period := 253;
Long_of_Per := 240;
axis := 11860;
Ecc := 0.13;
Inc := 29;
END;
WITH moons[5,11] DO
BEGIN
name := 'Carme';
radius := 15;
period := -692;
Long_of_Per := 240;
axis := 22600;
Ecc := 0.20678;
Inc := 164;
END;
WITH moons[5,12] DO
BEGIN
name := 'Ananke';
radius := 10;
period := -631;
Long_of_Per := 240;
axis := 21200;
Ecc := 0.1687;
Inc := 147;
END;
WITH moons[5,13] DO
BEGIN
name := 'Leda';
radius := 5;
period := 238.72;
Long_of_Per := 240;
axis := 11094;
Ecc := 0.14762;
Inc := 26.7;
END;
WITH moons[6,1] DO
BEGIN
name := 'Mimas';
radius := 200;
period := 0.942421813;
Long_of_Per := 0;
axis := 185.52;
Ecc := 0.0202;
Inc := 1.53;
END;
WITH moons[6,2] DO
BEGIN
name := 'Enceladus';
radius := 250;
period := 1.370217855;
Long_of_Per := 60;
axis := 238.02;
Ecc := 0.00452;
Inc := 0;
END;
WITH moons[6,3] DO
BEGIN
name := 'Tethys';
radius := 500;
period := 1.887802160;
Long_of_Per := 120;
axis := 294.66;
Ecc := 0;
Inc := 1.86;
END;
WITH moons[6,4] DO
BEGIN
name := 'Dione';
radius := 500;
period := 2.736914742;
Long_of_Per := 180;
axis := 377.4;
Ecc := 0.00223;
Inc := 0.02;
END;
WITH moons[6,5] DO
BEGIN
name := 'Rhea';
radius := 800;
period := 4.57500436;
Long_of_Per := 240;
axis := 527.04;
Ecc := 0.001;
Inc := 0.35;
END;
WITH moons[6,6] DO
BEGIN
name := 'Titan';
radius := 2900;
period := 15.94542068;
Long_of_Per := 0;
axis := 1221.83;
Ecc := 0.029192;
Inc := 0.33;
END;
WITH moons[6,7] DO
BEGIN
name := 'Hyperion';
radius := 100;
period := 21.2766088;
Long_of_Per := 60;
axis := 1481.1;
Ecc := 0.104;
Inc := 0.43;
END;
WITH moons[6,8] DO
BEGIN
name := 'Iapetus';
radius := 700;
period := 79.3301825;
Long_of_Per := 220;
axis := 3561.3;
Ecc := 0.02828;
Inc := 14.72;
END;
WITH moons[6,9] DO
BEGIN
name := 'Phoebe';
radius := 40;
period := -550.48;
Long_of_Per := 180;
axis := 12952;
Ecc := 0.02828;
Inc := 14.72;
END;
WITH moons[6,10] DO
BEGIN
name := 'Janus';
radius := 100;
period := 0.75;
Long_of_Per := 200;
axis := 159;
Ecc := 0;
Inc := 0;
END;
WITH moons[7,1] DO
BEGIN
name := 'Ariel';
radius := 400;
period := 2.52037932;
Long_of_Per := 0;
axis := 190.81;
Ecc := 0.0033;
Inc := 0;
END;
WITH moons[7,2] DO
BEGIN
name := 'Umbriel';
radius := 275;
period := 4.1441765;
Long_of_Per := 120;
axis := 265.83;
Ecc := 0.0011;
Inc := 0;
END;
WITH moons[7,3] DO
BEGIN
name := 'Miranda';
radius := 150;
period := 1.4134840;
Long_of_Per := 120;
axis := 129.79;
Ecc := 0.01;
Inc := 0;
END;
WITH moons[7,4] DO
BEGIN
name := 'Titania';
radius := 500;
period := 8.7058703;
Long_of_Per := 0;
axis := 436.05;
Ecc := 0.01;
Inc := 0;
END;
WITH moons[7,5] DO
BEGIN
name := 'Oberon';
radius := 450;
period := 13.4632423;
Long_of_Per := 120;
axis := 583.08;
Ecc := 0.0006;
Inc := 0;
END;
WITH moons[8,1] DO
BEGIN
name := 'Triton';
radius := 1900;
period := -5.8768441;
Long_of_Per := 120;
axis := 355.25;
Ecc := 0.01;
Inc := 160;
END;
WITH moons[8,2] DO
BEGIN
name := 'Nereid';
radius := 150;
period := 359.881;
Long_of_Per := 315;
axis := 5511;
Ecc := 0.7483;
Inc := 27.6;
END;
WITH moons[9,1] DO
BEGIN
name := 'Charon';
radius := 600;
period := 6.3867;
Long_of_Per := 0;
axis := 17;
Ecc := 0;
Inc := 0;
END;
END; {Orbital_Data}


  3 Responses to “Category : Science and Education
Archive   : PLANETS.ZIP
Filename : PLANETS1.3TP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/