HPHP48-R,*TBUASTROLIB DOC

*BUJulian DateUB,J

This is the number of
days elapsed since
BC4713 Jan 1st @12:00h

* UBAlgorithmBU

let date = D/M/Y
& time = UT

if Y<0, Y=Y+1
if M2, Y=Y-1 M=M+12

b=0

if D/M/Y15/10/1582,
 a=[Y/100],b=2-a+[a/4]

J=[1461Y/4]+b+D+UT/24
  +[306001(M+1)/10000]
  +1720994.5

* UBExamples

U1/1/2000 @12:00
 2451545

U9/9/1885 @17:52:31.38
 2409794.24480764

U8/10/2109 @3:35:49.15
 2491636.64987442

U4/12/3102 @23:59:59.99
 2854379.49999988

U29/2/2000 @00:00:01
 2451603.50001157

U1/3/1582 @18:30:00
 2298943.27083333

U15/10/1582 @12:00
 2299161

U4/10/1582 @12:00
 2299160

U1/1/0001 @12:00
 1721424

U31/12/0001BC @12:00
 1721423

U1/1/4000BC @12:00
 260424

U31/12/4700BC @12:00
 5113

U1/1/4713BC @12:00
 0

U31/12/4714BC @12:00
 -1

U31/12/9999BC @12:00
 -1930347

U31/12/9999 @23:59:59.99
 5373484.49999988

* UBInversion ofBU J

 ([x] = Floor(x))

Z=[J+0.5],
z=[J+0.5-Z],
a=[(Z-1867216.25)/
    36524.25]
A=(Z<2299161) ?
  Z : (Z+1+a-[a/4])
B=A+1524
C=[(B-122.1)/365.25]
D=[365.25C]
E=[(B-D)/30.6001]
DDdddddd=B-D
        -[30.6001E]
        +z
DD=[DDdddddd]
dddddd=DDdddddd-DD
Hour=[24dddddd]
Min=60(24dddddd-Hour)
Month=(E<14) ?
      (E-1) : (E-13)
Year=(Month>2) ?
     (C-4716):(C-4715)
if Year0, Year--

*UBSiderial time

GAST=Greenwich
     apparent Siderial
     Time.
GMST=Greenwich
     Mean Siderial
     Time.

GAST=GMST+.cos 
=GMST+eqn. of equinox

In degrees GAST=GHA

* BUTo compute GHA

1. obtain JD for 12:00
   on same day - J
J=[J+0.5]-0.5
2. compute T
T=(J-2451545)/36525
3. GMST
   =-0.0000062T
    +0.093104T
    +8640184.812866T
    +24110.54841
4. GMST=GMST/3600
5. GMST=GMST
       +1.00273791UT
6. GMST=15GMST
7. d=J-2449352.5
   O=241.1-0.053d
   Q=198.9+1.971d
   =-0.0048.sin O
      -0.0004.sin Q
   GHA=GMST+.cos 

*UBObliquityBU, 

=23.439291-.0130042T
 -.00000016T
 +.000000504T
T=(J-2451545)/36525

*UBGeographical position.

This is the position
at which the body lies
directly overhead and
is given by
(lat=,long=-GHA)
=Declination
GHA=Greenwhich Hour
    Angle
   =GHA-
=Right Ascension

*BUAltitude & Azimuth

H=Body/Horizon angle
Z=Body/North angle

*BUG.P.  H,Z

     [cos . cos -GHA
1. BxB= cos . sin -GHA
      sin           ]

2. Rotate about z-axis
   thru -long

BxB'=BRBz(-long).BxB

BRBz()=
[[cos -sin 0]
 [sin  cos 0]
 [0     0    1]]

3. Rotate about y-axis
   thru 90-lat

BxB"=BRBy(90-lat).BxB'

BRBy()=
[[cos  0 -sin ]
 [0     1  0    ]
 [sin  0  cos ]]

4. perform the tsfm:

 x'"=-x"
 y'"=y"
 z'"=z"

5. Then

 cos H. cos Z = x'"
 cos H. sin Z = y'"
 sin H        = z'"

*BUHeliocentric coords
* BUThe planets

*  UBorbital params

a=semi-major axis
e=eccentricity
i=inclination to ecl-
  iptic
L=mean longitude
=longitude of peri-
  helion
=longitude of ascend-
  ing node
M=mean anomaly
w=argument of peri-
  helion

BaB=[a0 a1 a2]
  a=a0+a1.p+a2.p
BeB=[e0 e1 e2]
  e=e0+e1.p+e2.p
...
BB=[0 1 2]
  =0+1.p+2.p

p=(J-2450000.5)/2280
Where 0p1

UN.B:
parameters for earth
are for the earth/moon
barycentre - the res-
ulting BxB may be
corrected by subtract-
ing:
 .0000312
 *[cos L sin L 0]
and the resulting BvB by
subtracting:
 .0000312L'
 *[-sin L cos L 0]
where L=218+481268T
 and  L'=481268/36525

*  UEarth*
BaB=[1.000003 -.000003 .000001]
BeB=[.016744 -.000082 .000031]
BiB=[-.00056 .00046 .00049]
BLB=[18.19185 2247.18581 .00081]
BB=[102.85504 .45924 -.40148]
BB=[158.2536 72.11722 -52.90426 ]

*  UMercury
BaB=[.387098 .000002 -.000001]
BeB=[.205642 -.000061 .000059]
BiB=[7.00517 -.00016 -.00016]
BLB=[51.63104 9330.54846 -.01681]
BB=[77.45291 -.00585 .01362]
BB=[48.33696 -.01165 .00344]

*  UVenus
BaB=[.723329 .000002 -.000001]
BeB=[.006775 .000001 -.000001]
BiB=[3.39486 -.00078 .00058]
BLB=[227.49013 3652.85655 -.00004]
BB=[131.60805 .02706 -.01524]
BB=[76.69269 -.01562 -.00421]

*  UMars
BaB=[1.523684 -.000039 .000035]
BeB=[.093323 .000109 -.000041]
BiB=[1.84992 .00032 -.00076]
BLB=[266.08046 1194.79883 -.00049]
BB=[336.02066 .19987 -.25415]
BB=[49.57328 -.02987 .01681]

*  UJupiter
BaB=[5.20187 .00398 -.00175]
BeB=[.04837 .00034 .00028]
BiB=[1.3045 .0012 -.0018]
BLB=[266.0411 189.5709 -.1863]
BB=[15.6975 .4078 -.9751]
BB=[100.471 -.0194 .0692]

*  USaturn
BaB=[9.55205 .07835 -.04718]
BeB=[.05201 .00386 .00211]
BiB=[2.4854 -.0011 .0014]
BLB=[358.2207 76.0747 .54]
BB=[91.0058 -10.6803 12.4994]
BB=[113.6365 .0266 -.0367]

*  UUranus
BaB=[19.30151 .03889 -.19958]
BeB=[.04489 -.01074 .01447]
BiB=[.7735 0 -.0018]
BLB=[295.012 27.6628 -.6092]
BB=[177.6743 -8.4452 -1.6997]
BB=[74.0971 .0472 -.2865]

*  UNeptune
BaB=[30.2808 -.00052 -.34749]
BeB=[.00808 .00885 -.00603]
BiB=[1.7703 -.0106 .0105]
BLB=[295.5181 14.9356 -.9686]
BB=[-.9818 22.5291 44.9834]
BB=[131.776 .0712 -.0618]

*  UPluto
BaB=[39.86362 -1.25752 .62251]
BeB=[.25564 -.02496 .01424]
BiB=[17.1158 .0159 .0464]
BLB=[232.9418 9.7148 -.953]
BB=[224.7949 .2691 -1.8207]
BB=[110.4043 -.0758 -.1188]

*  BUR*SD

I planet I I   SD*R   I
SUN      .2666
Mercury  .0009333
Venus    .002317
Mars     .0013
Jupiter  .02646
Saturn   .02175
Uranus   .009728
Neptune  .009306
Pluto    .000575

*  BUComputingB [x y z]

1. compute a,e,i,L,,
   from BaB,BeB,BiB,BLB,BB,BB

2. M=L-
   w=-

3. solve Keplers eqn.
   for eccentric ano-
   maly,  from:

  - e.sin  = M rads

4. coords in plane of
   orbit are then:

     a*[cos  - e
 BxB =    (1-e)sin 
        0]

      .0172021a/r*
 BvB = [-sin 
      (1-e)cos 
      0]

 Where r=|BxB|

5. Use ,i,w to trans-
   form to a fixed
   Heliocentric coord
   system.

 a. rotate thru w
    about z-axis.
 BRBz(w) = 
   [[cos w -sin w 0]
    [sin w  cos w 0]
    [0      0     1]]

 b. rotate thru i
    about x-axis
 BRBx(i) = 
   [[1 0      0    ]
    [0 cos i -sin i]
    [0 sin i  cos i]]

 c. rotate thru 
    about z-axis
 BRBz() =
   [[cos  -sin  0]
    [sin   cos  0]
    [0      0     1]]

BXB=BRBz().BRBx(i).BRBz(w).BxB
BVB=BRBz().BRBx(i).BRBz(w).BvB

*BUGeocentric coords
* BUThe Planets

1. Calculate BXB & BVB for
   the Earth for the
   current time.
   -
   Remember to correct
   for barycentre.
   let BEB=BXB, BE'B=BVB

2. Set =0.

3. Calculate BXB(J-)
   for a chosen Planet.
   In the case of the
   Sun this will be a
   zero vector.
   let BQB(J-)=BXB(J-)
   J- = p-/2280

4. Form BPB=BQB(J-)-BEB(J)

5. Compute  from

c=P+2/c.ln[(E+P+Q)/
              (E-P+Q)]
Where,
 E=|BEB(J)|,
 P=|BPB(J)|,
 Q=|BQB(J-)|
 /c=0.00000000987 au
 c=173.1446 au/day

6. follow steps 3 to 5
   using the new  to
   calc. a more accur-
   ate . if  is has
   converged suffic-
   iently stop iterat-
   ing.

7. keeping the most
   recent values for
   BEB=BEB(J),
   BQB=BQB(J-),
   & BPB=BQB-BEB
   compute the unit
   vectors:
   BeB=BEB/E
   BqB=BQB/Q
   BpB=BPB/P

8. correct BpB for
   gravitational def-
   lection

BpB=BpB +
 2/cE((BpB.BqB)BeB-(BeB.BpB)BqB)
       /(1+BqB.BeB)

9. correct for aber-
   ration using:

BpB=(BpB/+
  (1+BpB.BVB/(1+1/))BVB)/
  (1+BpB.BVB)

Where BVB=BEB'/c
       =.0057755BEB',
      =1/(1-V)

10. convert BpB to Geo-
    centric coords by
    matrix mult. with
    BRBx().

11. Correct for prec-
    ession by mult.
    with:

 BRBz(zA).BRBy(A).BRBz(A)

Where,
 A=.6406161T
   +.0000839T
   +.0000050T,
 A=.5567530T
   -.0001185T
   -.0000116T,
 zA=.6406161T
   +.0003041T
   +.0000051T.

12. Correct for nutat-
    ion.

d=J-2449352.5,
O=241.1-.053d,
Q=198.9+1.971d,
=-.0048 sin O
  -.0004 sin Q,
=.0026 cos O
  +.0002 cos Q.

rotation matrix,BNB=
[[1   -cos -sin]
 [cos  1     -  ]
 [sin        1 ]]

13. Convert to spher-
    ical polar coords,
    [r  ]

where
 x = r cos  cos ,
 y = r cos  sin ,
 z = r sin 

*BUGeocentric coords of
* BUthe Sun.

1. Obtain BEB(J)
2. BQB=B0B
3. BPB=-BEB
4. BpB=BPB/P
5. Correct for aber-
   ration with the
   same formula used
   for the Planets.
6. mult. by BRBx()
7. correct for preces-
   sion & nutation.
8. convert to sperical
   polar coords.

*UExample

Date: 1/1/1999 @12:00
Planet: Mars
J=2451180 T=-.009993155373
=23.439420953
p=.517324561404
UT=12
Earth:
a=1.00000171565
e=.0167098757517
i=-.000190894597857
L=1180.71648033
=102.985170166
=181.403122398
M=1077.73131016
w=-78.417952232
Kepler:
E=1077.692767
BEB=[.982481130768
   -.0402523784359 0]
BEB'=[.0174941737308
   .000703610028595 0]
w Rotation:
BEB=[.157820936952
   -.970557560449 0]
BEB'=[.0042016057623
   -.0169966964618 0]
i Rotation:
BEB=[.157820936952
   -.970557560443
   .0000032336447252]
BEB'=[.0042016057623
   -.0169966964617
   .0000000566285608389]
 Rotation:
BEB=[-.18153932645
   -.966402038091
   .0000032336447252]
BEB'=[-.00461653823249
   .0168887168353
   .0000000566285608389]
Barycentre correction:
L=-4591.38590007
BEB'=[.000410983412134
     -.000009943019451
     0]
BEB=[-.000000754608212
    -.0000311908731273
    0]
BEB=[-.181540081058
   -.966370847218
   .0000032336447252]
BEB'=[-.00420555482036
   .0168787738158
   .0000000566285608389]
GHA=280.69688732
E=0.983274842246
UMars:
U=0:
a=1.52367319121
e=.0933684157644
i=1.84988214909
L=884.179109559
=336.056040842
=49.5623262866
M=L-=548.123068717
w=-=286.493714555
BQB=[-1.58989550847
   .491078700057
   .0493707475428]
BPB=BQB-BEB
 =[-1.40835542741
   -.475292147161
   .0493675138981]
P=1.48721376624
Q=1.66474126765
 =.00858943213545
U=.00858943213545:
a=1.52367319122
e=.0933684155136
i=1.84988215084
L=884.1746084
=336.05604108
=49.5623263336
BQB=[-1.58986454062
   .491183287029
   .0493721773397]
BPB=[-1.40832445956
   -.475187560189
   .049368943695]
P=1.48715106608
Q=1.66474258997
 =.00858907000946
U=.00858907000946:
a=1.52367319122
e=.0933684155136
i=1.84988215084
L=884.17460859
=336.05604108
=49.5623263336
BQB=[-1.58986454191
   .491183282608
   .04937217729]
BPB=[-1.40832446085
   -.47518756461
   .0493689436343]
P=1.48715106872
Q=1.6647425899
 =.00858907002471
UGrav. defl.
BeB=[-.184628013713
   .982808473988
   .00000328864787979]
BqB=[-.955021245661
   .295050589556
   .0296575444093]
BpB=[-.946994888732
   -.319528778619
   .0331969930108]
BpB=[-.946994892474
   -.319528767523
   .0331969930655]
Uaberration
BpB=[-.947026901759
   -.319433888601
   .033197264018]
UGeocentric coords
BpB=[-.947026901759
   -.306279757148
   -.0966063035518]
UPrecession
BpB=[-.947104696981
   -.306068122538
   -.0965143383236]
UNutation
BpB=[-.947119528467
   -.306031616354
   -.096484564604]
UPolar coords
=-5.5367715964
=197.906592189
R=1.4871510938

*UBThe Stars

1. compute =0+0.T
           =0+0.T
2. form
   BpB=[cos  cos 
      cos  sin 
      sin ]
3. correct for grav.
   deflection

BpB=BpB+2/c(BeB-(BpB.BeB)BpB)
        /(1+BpB.BeB)

4. correct for aber-
   ration using same
   formula as for the
   planets.

5. mult. by matrix,
   BRBx()

6. correct for preces-
   sion & nutation.
7. transform to spher-
   ical polar coords.

UExample
Date: 23/8/1997

0=23.2723278109
0=-.00152001801857
0=-53.741327814
0=.00141433773382

BpB=[.543310652902
   .233675928572
   -.806355439524]
BEB=[.881322847377
   -.495552333534
   -.00000276291474868]
E=1.01108954924
BeB=[.871656568935
   -.490117155208
   -.00000273261132088]
UGravity:
BpB=[.543310662838
   .233675920142
   -.806355435272]
UAberration:
BpB=[.543316319931
   .233771557759
   -.806323902212]
UGeocentric coords:
BpB=[.543316319931
   .53522189779
   -.646795869361]
UPrecession:
BpB=[.54345016702
   .534935542807
   -.646920304989]
UNutation:
BpB=[.543452033612
   .53490385534
   -.646944939171]
UPolar coords:
=-40.311657402
=44.5458231516

*BU,  for bright stars

I      Star       I I     0      I I      0        I I      0     I I       0       I
Acamar   -  Eri  23.2723274931 -1.52002111589E-3 -53.740227815 1.41435154174E-3
Achernar -  Eri  345.311703996 2.84938087517E-3  -59.37825935  -1.8786533815E-3
Acrux    -  Cru  221.870138544 -4.71733389092E-4 -52.878638427 -7.74328291725E-5
Adhara   -  CMa  110.762937237 2.52724456036E-4  -51.360159136 7.49606793186E-5
Aldebaran-  Tau  69.7892519526 1.03575092172E-3  -5.4673621744 -5.47147943664E-3
Alioth   -  UMa  158.933445653 4.16705192731E-3  54.3187947623 2.83194121942E-4
Alkaid   -  UMa  176.933159354 -4.29617751111E-3 54.38806071   -2.07660815371E-3
Al nair  -  Gru  315.907009922 1.83273027835E-3  -32.913310788 -2.99234490181E-3
Alnilam  -  Ori  83.4635400129 -2.45601026999E-5 -24.506403199 -4.63963313306E-5
Alphard  -  Hya  147.279235203 -7.37621682614E-4 -22.382501416 3.83419730328E-4
Alphecca -  CrB  222.29591595  5.68298900217E-3  44.323612588  2.16973165556E-3
Alpheratz-  And  14.3085806371 1.61670434378E-3  25.6803857155 -5.31811104644E-3
Altair   -  Aql  301.776471029 1.93777159198E-2  29.3034875421 -2.61353495346E-3
Ankaa    -  Phe  345.493813719 -1.00252149408E-3 -40.633166371 -1.19560876261E-2
Antares  -  Sco  249.762249804 -6.82250666453E-5 -4.5699912333 -6.04050673367E-4
Arcturus -  Boo  204.233733929 -7.67679027389E-3 30.7362730159 -.0598615795
Atria    -  TrA  260.896142468 1.23065774141E-3  -46.151304398 -1.81515183474E-4
Avior    -  Car  173.129481754 -2.50299856874E-3 -72.679883004 -2.98159791706E-4
Bellatrix-  Ori  80.9464516187 -3.15788960106E-4 -16.816070541 -2.81999778414E-4
Betelgeu.-  Ori  88.7546439839 8.02498333675E-4  -16.026949944 2.10436085131E-4
Canopus  -  Car  104.961391946 3.08630870136E-3  -75.823867726 -2.1401860265E-4
Capella  -  Aur  81.8579065019 1.26571532504E-3  22.8643442124 -8.25653447336E-3
Deneb    -  Cyg  335.329336728 2.88913399081E-4  59.9061772882 -1.06361887037E-4
Denebola -  Leo  171.617559445 -1.15326016058E-2 12.2669140659 -7.78602252267E-3
Diphda   -  Cet  2.58348395455 6.72672147408E-3  -20.783521361 -2.11644242312E-3
Dubhe    -  UMa  135.197588273 -2.39066537661E-3 49.6802439433 -2.70959792509E-4
Elnath   -  Tau  82.5749090883 3.70236776222E-4  5.3850600285  -4.81199355075E-3
Eltanin  -  Dra  267.968658026 -7.98165172442E-4 74.9222265861 4.65901142928E-4
Enif     -  Peg  331.884934126 8.98504578136E-4  22.0999129678 -5.33892608283E-4
Fomalhaut-  PsA  333.860433946 7.16186633733E-3  -21.135692148 -5.7136003275E-3
Gacrux   -  Cru  216.739671286 7.36973628006E-3  -47.831176052 -6.8059406715E-3
Gienah   -  Crv  190.725570888 -4.48535189767E-3 -14.500979654 -8.815824295E-4
Hadar    -  Cen  233.792526441 -3.57021252097E-4 -44.137580973 -1.10225555454E-4
Hamal    -  Ari  37.6624740259 3.6387657515E-3   9.9651204553  -4.96019548936E-3
Kaus Aus.-  Sgr  275.078726063 -1.05434819036E-3 -11.051868334 -3.24680136736E-3
Kochab   -  UMi  133.319496982 -1.13083992701E-3 72.9875858742 2.87533403769E-4
Markab   -  Peg  353.485705453 1.24810776221E-3  19.4060321592 -.001899543017
Menkar   -  Cet  44.3201010087 -9.04847702158E-4 -12.585560382 -1.69297439714E-3
Menkent  -  Cet  222.308621    -8.72945644467E-3 -22.079942876 -1.32874582269E-2
Miaplaci.-  Car  211.969201739 -1.25503137608E-2 -72.235711402 1.65712471764E-3
Mirfac   -  Per  62.0809130375 5.12346241136E-4  30.1255344622 -3.27153653694E-4
Nunki    -  Sgr  282.385281876 2.54405511434E-4  -3.44952424   -1.54435270865E-3
Peacock  -  Pav  293.817626756 -4.08976157053E-4 -36.267652161 -1.1540201021E-3
Pollux   -  Gem  113.21560515  -1.70025579305E-2 6.6842010755  -2.82919380131E-3
Procyon  -  CMi  115.785482046 -1.50461923725E-2 -16.019585974 -3.06774244778E-2
Rasalhag.-  Oph  262.448701845 4.59002687542E-3  35.8352571039 -1.42054672277E-3
Regulus  -  Leo  149.829183703 -6.48850256172E-3 .4649122809   -2.18374645489E-3
Rigel    -  Ori  76.829526474  -2.57481475353E-5 -31.122763067 -2.90529644611E-5
Rigil ke.-  Cen  239.479439138 -.13497760231     -42.595903924 5.11097405256E-2
Sabik    -  Oph  257.969555039 8.29288721808E-4  7.1978101302  2.70627414781E-3
Schedar  -  Cas  37.7838047984 1.05304515948E-3  46.6221432285 -4.36567483172E-4
Shaula   -  Sco  264.585847015 6.86323141942E-5  -13.788425434 -7.03328278172E-4
Sirius   -  Cma  104.081585629 -1.52360381513E-2 -39.605274123 -1.17586685572E-2
Spica    -  Vir  203.841382604 -7.50128029319E-4 -2.054487943  -1.15473168587E-3
Suhail   -  Vel  161.187750766 -1.15541089747E-3 -55.870798775 -2.32177676267E-4
Vega     -  Lyr  285.316347248 1.40272456538E-2  61.7328040051 -6.12371993506E-3
Zubenubi -  Lib 225.082692139 -2.25760560228E-3 .3329960609   -2.68735493126E-3
Polaris  -  UMi  88.5675958479 9.83697150064E-4  66.1014079608 8.04191073467E-4
Octantis -  Oct  271.870374062 1.17627694566E-3  -65.840314294 3.11815683375E-4