The first line contains a calendar date in "YYYY.MMDD, hh:mm:ss" format, stored in Str 1.

The 2nd line contains the Keplerian elements of the observed object's orbit, stored in List 1.

The Keplerian elements are, in order, the semimajor axis in astronomical units, the eccentricity, the inclination to the ecliptic (degrees), the longitude of the ascending node (degrees), the argument of the perihelion (degrees), and the time of perihelion passage in Julian date format.

The semimajor axis for any hyperbolic orbit should be entered as an intrinsically negative number.

"2014.0106, 12:00:00"→Str 1↵ {-4693.4,1.0000026666,61.7852,295.7508,345.5009,2456625.3147}→List 1↵ Exp(StrLeft(Str 1,4))→Y↵ Exp(StrMid(Str 1,6,2))→M↵ Exp(StrMid(Str 1,8,2))→D↵ Exp(StrMid(Str 1,12,2))+Exp(StrMid(Str 1,15,2))÷60+Exp(StrMid(Str 1,18,2))÷3600→T↵ Int ((M−14)÷12)→A↵ Int ((1461(Y+4800+A))÷4)→B↵ Int ((367(M−2−12A))÷12)→C↵ Int ((Y+4900+A)÷100)→E↵ Int ((3E)÷4)→F↵ B+C−F+D−32075.5→J↵ J+T÷24→T¸ If List 1[1]=0 Or List 1[2]≤0 Or List 1[2]=1:Then Stop:IfEnd↵ If List 1[1]>0 And List 1[2]>1:Then Stop:IfEnd↵ If List 1[1]<0 And List 1[2]<1:Then Stop:IfEnd↵ (π÷180)List 1[3]→List 1[3]↵ (π÷180)List 1[4]→List 1[4]↵ (π÷180)List 1[5]→List 1[5]↵ If List 1[1]>0:Then Goto 2:IfEnd↵ 1.32712440018ᴇ20→G↵ 1.49597870691ᴇ11→O↵ 86400√(G÷(-OList 1[1])^3)→M↵ M(T−List 1[6])→M↵ 0→U↵ 1→V↵ While Abs (V−U)>1ᴇ-12↵ U→V↵ List 1[2]sinh V−V−M→F↵ List 1[2]cosh V−1→G↵ List 1[2]sinh V→H↵ List 1[2]cosh V→I↵ -F÷G→A↵ -F÷(G+AH÷2)→B↵ -F÷(G+AH÷2+B²I÷6)→C↵ V+C→U↵ WhileEnd↵ cos⁻¹ ((List 1[2]−cosh U)÷(List 1[2]cosh U−1))→F↵ If U<0:Then 2π−F→F:IfEnd↵ List 1[1](1−List 1[2]cosh U)→R¸ Rcos F→List 2[1]↵ Rsin F→List 2[2]↵ List 2[1]cos List 1[5]−List 2[2]sin List 1[5]→List 3[1]↵ List 2[1]sin List 1[5]+List 2[2]cos List 1[5]→List 3[2]↵ List 3[1]→List 2[1]↵ List 3[2]cos List 1[3]→List 2[2]↵ List 3[2]sin List 1[3]→List 2[3]↵ List 2[1]cos List 1[4]−List 2[2]sin List 1[4]→List 3[1]↵ List 2[1]sin List 1[4]+List 2[2]cos List 1[4]→List 3[2]↵ List 2[3]→List 3[3]↵ Goto 3↵ Lbl 2↵ 365.256898326List 1[1]^1.5→P↵ (T−List 1[6])÷P→M↵ M−Int M→M↵ If M<0:Then M+1→M:IfEnd↵ 2πM→M↵ M→U↵ 9→V↵ While Abs (V−U)>1ᴇ-12↵ U→V↵ V−List 1[2]sin V−M→F↵ 1−List 1[2]cos V→G↵ List 1[2]sin V→H↵ List 1[2]cos V→I↵ -F÷G→A↵ -F÷(G+AH÷2)→B↵ -F÷(G+AH÷2+B²I÷6)→C↵ V+C→U↵ WhileEnd↵ List 1[1](cos U−List 1[2])→List 2[1]↵ List 1[1]√(1−List 1[2]²)sin U→List 2[2]↵ √(List 2[1]²+List 2[2]²)→R¸ List 2[1]cos List 1[5]−List 2[2]sin List 1[5]→List 3[1]↵ List 2[1]sin List 1[5]+List 2[2]cos List 1[5]→List 3[2]↵ List 3[1]→List 2[1]↵ List 3[2]cos List 1[3]→List 2[2]↵ List 3[2]sin List 1[3]→List 2[3]↵ List 2[1]cos List 1[4]−List 2[2]sin List 1[4]→List 3[1]↵ List 2[1]sin List 1[4]+List 2[2]cos List 1[4]→List 3[2]↵ List 2[3]→List 3[3]↵ Lbl 3↵ {1.000003,0.016701,0,0,103.154,2456294.541}→List 4↵ (π÷180)List 4[3]→List 4[3]↵ (π÷180)List 4[4]→List 4[4]↵ (π÷180)List 4[5]→List 4[5]↵ 365.2563496155List 4[1]^1.5→P↵ (T−List 4[6])÷P→M↵ M−Int M→M↵ If M<0:Then M+1→M:IfEnd↵ 2πM→M↵ M→U↵ 9→V↵ While Abs (V−U)>1ᴇ-12↵ U→V↵ V−List 4[2]sin V−M→F↵ 1−List 4[2]cos V→G↵ List 4[2]sin V→H↵ List 4[2]cos V→I↵ -F÷G→A↵ -F÷(G+AH÷2)→B↵ -F÷(G+AH÷2+B²I÷6)→C↵ V+C→U↵ WhileEnd↵ List 4[1](cos U−List 4[2])→List 2[1]↵ List 4[1]√(1−List 4[2]²)sin U→List 2[2]↵ √(List 2[1]²+List 2[2]²)→R¸ List 2[1]cos List 4[5]−List 2[2]sin List 4[5]→List 5[1]↵ List 2[1]sin List 4[5]+List 2[2]cos List 4[5]→List 5[2]↵ List 5[1]→List 2[1]↵ List 5[2]cos List 4[3]→List 2[2]↵ List 5[2]sin List 4[3]→List 2[3]↵ List 2[1]cos List 4[4]−List 2[2]sin List 4[4]→List 5[1]↵ List 2[1]sin List 4[4]+List 2[2]cos List 4[4]→List 5[2]↵ List 2[3]→List 5[3]↵ List 3[1]−List 5[1]→List 6[1]↵ List 3[2]−List 5[2]→List 6[2]↵ List 3[3]−List 5[3]→List 6[3]↵ (T−2451545)÷36525→W 84381.448−46.84024W−5.9ᴇ-4W²+1.813ᴇ-3W^3→θ↵ πθ÷648000→θ↵ List 6[1]→X↵ List 6[2]cos θ−List 6[3]sin θ→Y↵ List 6[2]sin θ+List 6[3]cos θ→Z↵ √(X²+Y²+Z²)→R↵ tan⁻¹ (Y÷X)→A↵ If X<0:Then A+π→A:IfEnd↵ If X>0 And Y<0:Then A+2π→A:IfEnd↵ (12÷π)A→A↵ (180÷π)sin⁻¹ (Z÷R)→D↵ R¸ θ¸ A¸ D¸ Locate 1,1,"t(JD)"↵ Locate 1,2,"r(AU)"↵ Locate 1,3,"R(AU)"↵ Locate 1,4,"ε(rad)"↵ Locate 1,5,"a(h)"↵ Locate 1,6,"δ(°)"↵

The output from the program are...

(1) The input date, converted to Julian Date format.

(2) The distance of the observed object from the sun in astronomical units.

(3) The distance of the observed object from Earth in astronomical units.

(4) Earth's obliquity (axis tilt) on the input date in radians.

(5) The right ascension of the object in Earth's sky in decimal hours.

(6) The declination of the object in Earth's sky in decimal degrees.

With the right ascension and declination known, you could look in a star atlas and find out which constellation the comet is in, then go outside and find the comet.

**Edited by flyingfisch, 18 February 2013 - 03:46 PM.**