Post Reply 
Astro and Astronawigational Program
04-12-2020, 09:43 AM
Post: #1
Astro and Astronawigational Program
Good day.

Wrote program which finally shall be used as star finder (120 nav stars) and finally shall draw Line of Position from given stars.
First part of the program (star finder) is done but facing some issues.

1. To use the program first You have to create spreadsheet STARDAT. This spreadsheet is used as storage of data and easy tool to manipulate some data further. Generally spreadsheet could be avoided as i could do the same manipulating only lists within the program. I just did it to have easier view of data and to learn how to manipulate list and spreadsheets)
2. Once the program is executed first time please make sure You enter at least year (between 1986 and 2050) and any month and date. Other fields may remain "0"
3. Go back to STARDAT and in column I enter formula"=5.3-(F:F)" and in column J please enter formula "=sqr(I:I)". This is required to have proper magnitude of the stars to be displayed. (magnitude range is between 0 and 5.23)
4. Now the program shall run properly on stars shall be displayed one by one (only stars above horizon). The idea is while taking sights by sextant - You may get as well observed aprox azimuth so while passing through displayed stars - You may know which star was taken. This shall be noted down to enter further data for LOP.
5. The name of the star is dimmed after each ENTER due to fact they are overlapping sometimes and difficult to read on small screen. So in attached screenshot You see blue dimmed stars already.

Now the problem starts.
1. The program is used on HP android emulator Galaxy Note 9 so would like to write program with MOUSE function to touch the star with stylus and choose the star for further LOP, 9choise to be shifted to new list for further LOP). I have no idea how to do this
2. Problem is the program runs only if earlier the STARDAT spreadsheet was viewed from Application screen. Otherwise if as example I view Adv Graphing application - error appear. I have no idea how to tell program to avoid this error.

Any ideas?

Below code:
Code:

EXPORT AASTRO()
BEGIN
LOCAL A,B,C,D,E,F,G,H;
LOCAL YR,MN,DA,si,dip;
LOCAL I,L1,L2,L3,L4,L5,L6,L10;
LOCAL L11,L12,L13,L14,L15,L10:={};
LOCAL L11:={},L12:={},L13:={},L14:={},L15:={};
PRINT();
I:=1;
L1:={"Acamar","Achernar","Acrux","Adhara","Albaldah","Albireo","Alcyone","Aldebaran","Alderamin","Algenib","Algieba","Algol","Algorab","Alhena","Alioth","Alkaid","Almaak","Alnair","Alnath","Alnilam","Alnitak","Alphard","Alphekka","Alpheratz","Altair","Aludra","Ankaa","Antares","Arcturus","Arneb","Atria","Avior","Becrux","Bellatrix","Betelgeuse","Canopus","Capella","Caph","Castor","Cebalrai","Cih","CorCaroli","Cursa","Deneb","Denebola","Diphda","Dschubba","Dubhe","Enif","Etamin","Fomalhaut","Gacrux","Gienah","GienahGhurab","Gomeisa","Graffias","Hadar","Hamal","Hassaleh","Hatsya","Izar","KausAustralis","KausBorealis","KausMeridionalis","Kochab","Kornephoros","Kraz","Markab","Matar","Menkalinan","Menkar","Menkent","Merak","Miaplacidus","Mintaka","Mirach","Mirphak","Mirzam","Mizar","Mufrid","Naos","Nash","Nihal","Nunki","Peacock","Phad","Phakt","Polaris","Pollux","Porrima","Procyon","RasElasedAustralis","Rasalgethi","Rasalhague","Rastaban","Regulus","Rigel","RigilKentaurus","Ruchbah","Sadalmelik","Sadalsuud","Sadr","Saiph","Sargas","Scheat","Shaula","Shedir","Sheratan","Sirius","Spica","Tarazed","Tureis","Unukalhai","Vega","Vindemiatrix","Wezen","Zaurak","Zosma","Zubenelgenubi","Zubeneschemali"};
L2:={2.971026667,1.628556,12.443311,6.977097,19.162731,19.512023,3.79141,4.59867​7,21.30963,0.220598,10.332873,3.136148,12.497739,6.628528,12.900472,13.792354,2.​064984,22.137209,5.438198,5.603559,5.679313,9.45979,15.578128,0.139791,19.846388​,7.401584,0.438056,16.490128,14.26103,5.545504,16.811077,8.375236,12.795359,5.41​8851,5.919529,6.399195,5.27815,0.152887,7.576634,17.724543,0.945143,12.933807,5.​130829,20.690532,11.817663,0.72649,16.005557,11.062155,21.736433,17.943437,22.96​0838,12.519429,20.770178,12.263437,7.452512,16.09062,14.063729,2.119555,4.949894​,5.590551,14.749784,18.402868,18.466179,18.3499,14.845105,16.503668,12.573121,23​.079348,22.716704,5.992149,3.037992,14.111395,11.030677,9.220041,5.533445,1.1621​94,3.405378,6.378329,13.398747,13.911411,8.059737,18.096803,5.470756,18.92109,20​.427459,11.897168,5.660817,2.52975,7.755277,12.694345,7.655033,9.764188,17.24412​7,17.582241,17.507213,10.139532,5.242298,14.660765,1.430216,22.096399,21.525982,​20.370473,5.795941,17.62198,23.062901,17.560145,0.675116,1.910668,6.752481,13.41​9883,19.770994,9.284838,15.737798,18.61564,13.036278,7.139857,3.967157,11.235138​,14.847977,15.283449};
L3:={-40.30471389,-57.236757,-63.099092,-28.972084,-21.023615,27.959681,24.105137,16.509301,62.585573,15.183596,19.841489,40.955648,​-16.515432,16.399252,55.959821,49.313265,42.329725,-46.960975,28.60745,-1.20192,-1.942572,-8.658603,26.714693,29.090432,8.868322,-29.303104,-42.305981,-26.432002,19.18241,-17.822289,-69.027715,-59.509483,-59.688764,6.349702,7.407063,-52.69566,45.997991,59.14978,31.888276,4.567303,60.71674,38.31838,-5.086446,45.280338,14.57206,-17.986605,-22.62171,61.751033,9.875011,51.488895,-29.622236,-57.113212,33.970256,-17.541929,8.289315,-19.805453,-60.373039,23.462423,33.16609,-5.909901,27.074222,-34.384616,-25.4217,-29.828103,74.155505,21.489613,-23.396759,15.205264,30.221245,44.947433,4.089734,-36.369954,56.382427,-69.717208,-0.299092,35.620558,49.86118,-17.955918,54.925362,18.397717,-40.003148,-30.424091,-20.759441,-26.296722,-56.73509,53.69476,-34.074108,89.264109,28.026199,-1.449375,5.224993,23.774255,14.390333,12.560035,52.301387,11.967207,-8.20164,-60.833976,60.235283,-0.319851,-5.571172,40.256679,-9.669605,-42.997824,28.082789,-37.103821,56.537331,20.808035,-16.716116,-11.161322,10.613261,-59.275229,6.425627,38.783692,10.95915,-26.3932,-13.508515,20.523717,-16.041778,-9.382917};
L4:={-0.0446,0.08802,-0.03537,0.00263,-0.00117,-0.00709,0.01935,0.06278,0.14991,0.0047,0.31077,0.00239,-0.20997,-0.00204,0.11174,-0.12123,0.04308,0.1276,0.02328,0.00149,0.00399,-0.01449,0.12038,0.13568,0.53682,-0.00376,0.23276,-0.01016,-1.09345,0.00327,0.01785,-0.02534,-0.04824,-0.00875,0.02733,0.01999,0.07552,0.52339,-0.20633,-0.04067,0.02565,-0.23343,-0.08339,0.00156,-0.49902,0.23279,-0.00867,-0.13646,0.03002,-0.00852,0.32922,0.02794,0.35616,-0.15958,-0.05028,-0.00675,-0.03396,0.19073,0.00363,0.00227,-0.05065,-0.03961,-0.04481,0.02996,-0.03229,-0.09843,0.00086,0.0611,0.01311,-0.05641,-0.01181,-0.51929,0.08166,-0.15766,0.00167,0.17559,0.02411,-0.00345,0.12123,-0.06095,-0.03082,-0.05575,-0.00503,0.01387,0.00771,0.10776,-0.0001,0.04422,-0.62569,-0.61666,-0.71657,-0.04609,-0.00671,0.11008,-0.01559,-0.2494,0.00187,-3.67819,0.29724,0.0179,0.02279,0.00243,0.00155,0.00606,0.18776,-0.0089,0.05036,0.09632,-0.54601,-0.0425,0.01572,-0.01903,0.13466,0.20102,-0.27505,-0.00275,0.06051,0.14331,-0.10569,-0.09639};
L5:={0.019,-0.04008,-0.01473,0.00229,-0.03683,-0.00563,-0.04311,-0.18936,0.04827,-0.00824,-0.15288,-0.00144,-0.1393,-0.06692,-0.00899,-0.01556,-0.05085,-0.14791,-0.17422,-0.00106,0.00254,0.03325,-0.08944,-0.16295,0.38554,0.00666,-0.35364,-0.02321,-1.9994,0.00154,-0.03292,0.02272,-0.01282,-0.01328,0.01086,0.02367,-0.42713,-0.18042,-0.14818,0.1588,-0.00382,0.05498,-0.07544,0.00155,-0.11378,0.03271,-0.0369,-0.03525,0.00138,-0.02305,-0.16422,-0.26433,0.33028,0.02231,-0.03845,-0.02489,-0.02506,-0.14577,-0.01854,-0.00062,0.02,-0.12405,-0.18629,-0.02638,0.01191,-0.01449,-0.056,-0.04256,-0.02611,-0.00088,-0.07876,-0.51787,0.03374,0.10891,0.00056,-0.11223,-0.02601,-0.00047,-0.02201,-0.3581,0.01677,-0.18153,-0.08592,-0.05265,-0.08615,0.01116,-0.02405,-0.01174,-0.04595,0.06066,-1.03458,-0.00957,0.03278,-0.22261,0.01157,0.00491,-0.00056,0.48184,-0.04949,-0.00993,-0.0067,-0.00093,-0.0012,-0.00095,0.13761,-0.02995,-0.03217,-0.1088,-1.22308,-0.03173,-0.00308,0.01311,0.04414,0.28746,0.01996,0.00333,-0.11134,-0.13043,-0.069,-0.02076};
L6:={2.88,0.45,0.77,1.5,2.88,3.05,2.85,0.87,2.45,2.83,2.01,2.09,2.94,1.93,1.76,1​.85,2.1,1.73,1.65,1.69,1.74,1.99,2.22,2.07,0.76,2.45,2.4,1.06,-0.05,2.58,1.91,1.86,1.25,1.64,0.45,-0.62,0.08,2.28,1.58,2.76,2.15,2.89,2.78,1.25,2.14,2.04,2.29,1.81,2.38,2.24,1.17,​1.59,2.48,2.58,2.89,2.56,0.61,2.01,2.69,2.75,2.35,1.79,2.82,2.72,2.07,2.78,2.65,​2.49,2.93,1.9,2.54,2.06,2.34,1.67,2.25,2.07,1.79,1.98,2.23,2.68,2.21,2.98,2.81,2​.05,1.94,2.41,2.65,1.97,1.16,2.74,0.4,2.97,2.78,2.08,2.79,1.36,0.18,-0.01,2.66,2.95,2.9,2.23,2.07,1.86,2.44,1.62,2.24,2.64,-1.44,0.98,2.72,2.21,2.63,0.03,2.85,1.83,2.97,2.56,2.75,2.61};
FOR I FROM 1 TO 120 DO
STARDAT.Cell(I,1):=L1(I);
STARDAT.Cell(I,2):=L2(I);
STARDAT.Cell(I,3):=L3(I);
STARDAT.Cell(I,4):=L4(I);
STARDAT.Cell(I,5):=L5(I);
STARDAT.Cell(I,6):=L6(I);
END;
INPUT({A,B,C,D,E,F,G},"Enter data",{"Air temp","Sea temp","Pressure","Eye height","Time of obs","Lattitude","Longitude"});
INPUT({YR,MN,DA,si},"Enter data",{"Year","Month","Day","Sext index err"});
LOCAL ho,min,sec;
si:=si/60;
dip:=(-1.76*√(D)+.34*(A-B)-.2)/60;

E:=HMS→(E);
ho:=IP(E);
min:=IP(FP(E)*60);
sec:=IP(FP(FP(E)*60)*60);

LOCAL a,b,JD,DF;
DF:=DA+(ho*3600+min*60+sec)/86400;
IF (MN=1 OR MN=2)
THEN
YR:=YR-1;
MN:=MN+12
END;
IF YR*100+MN+DF>=158225
THEN
a:=IP(ABS(YR/100));
b:=2-a+IP(a/4);
ELSE
b:=0
END;
JD:=IP(365.25*(YR+4716))+IP(30.6001*(MN+1))+DF+b-1524.5;
LOCAL k,dt,dfdt,jde,tau,t,to;
k:=YR+(MN-.5)/12-2000;
//below dt only for period 1986 2050
IF YR≤2005 THEN
63.86+k*(.3345+k*(-.060374+k*(.0017275+k*(.000651814+.00002373599))))▶dt;
ELSE
62.92+k*(.32217+.005589*k)▶dt
END;
dfdt:=DA+(ho*3600+min*60+sec+dt)/86400;
DA:=DA+(ho*3600+min*60+sec)/86400;
jde:=IP(365.25*(YR+4716))+IP(30.6001*(MN+1))+dfdt+b-1524.5;
tau:=(jde-2451545)/365250;
t:=tau*10;
to:=t*100;
0▶HAngle;
LOCAL lo,lp,om,dp,npsid,npsir,deps,epsor;
LOCAL de,nepsd,nepsr,epsr,g,gasd,gastd;
lo:=(280.4665+36000.7698*t)*π/180;
lp:=(218.3165+481267.8813*t)*π/180;
om:=(125.04452-1934.136261*t)*π/180;
dp:=-17.2*SIN(om)-1.32*SIN(2*lo)-.23*SIN(2*lp)+.21*SIN(2*om);
npsid:=dp/3600;
npsir:=npsid*π/180;
deps:=t*(-46.815*t*(-.000059+.001813*t));
epsor:=(23.4392911+deps/3600)*π/180;
de:=9.2*COS(om)+.57*COS(2*lo)-.1*COS(2*lp)-.09*COS(2*om);
nepsd:=de/3600;
nepsr:=nepsd/3600;
epsr:=epsor+nepsr;
g:=280.46061837+360.98564736629*(JD-2451545)+(t^2)*(0.000387933-t/38710000);
gasd:=g+npsid*COS(epsr);
gastd:=gasd-IP(gasd/360)*360;
gastd:=→HMS(gastd);
//PRINT("Gha ɤ for time ");
E:=→HMS(E);
//PRINT(E);
//PRINT(gastd);
gastd:=HMS→(gastd);
LOCAL zr,zd,td,tr,lm,md;
LOCAL mr,ca,cb,cc,ccc;
LOCAL zde,ls,lsd,lsr,ec,pp,pr,pd;
1▶HAngle;
zde:=t*(2306.2181+t*(.30188+t*.017998))/3600;
zr:=zde*π/180;
zd:=t*(2306.2181+t*(1.09468+t*.018203))/3600;
td:=t*(2004.3109-t*(.42665+t*.041833))/3600;
tr:=td*π/180;
lm:=280.46646+t*(36000.76983+t*0.0003032);
md:=357.52911+t*(35999.05029-t*.0001537);
mr:=md*π/180;
ca:=1.914602-t*(.004817+t*.000014);
cb:=.019993-t*(.000101);
cc:=.000289;
0▶HAngle;
ccc:=ca*SIN(mr)+cb*SIN(2*mr)+cc*SIN(3*mr);
1▶HAngle;
ls:=ccc+lm;
lsd:=ls-360*IP(ls/360);
lsr:=lsd*π/180;
ec:=.016708634-t*(.000042037+.0000001267*t);
pp:=102.93735+t*(1.71946+.000464);
pd:=pp-360*IP(pp/360);
pr:=pd*π/180;
I:=1;
FOR I FROM 1 TO 120 DO
L1(I):=STARDAT.Cell(I,2);
L2(I):=STARDAT.Cell(I,3);
L3(I):=STARDAT.Cell(I,4);
L4(I):=STARDAT.Cell(I,5);
END;
LOCAL L16:={},L17:={},L18:={},L19:={};
LOCAL L20:={},L21:={},L22:={},L23:={};
LOCAL L24:={},L25:={},L26:={},L27:={};
LOCAL L28:={},L29:={},L30:={},L31:={};
LOCAL L32:={},L33:={},L34:={},L35:={};
LOCAL L36:={},L37:={},L38:={},L39:={};
LOCAL L40:={},L41:={},L42:={};
0▶HAngle;
L6:=L1*15;
L7:=L6+L3/3600*to;
L8:=L2+L4/3600*to;
L12:=L7*π/180;
L13:=L8*π/180;
L9:=COS(L13)*SIN(L12+zr);
L10:=COS(tr)*COS(L13)*COS(L12+zr)-SIN(tr)*SIN(L13);
L11:=SIN(tr)*COS(L13)*COS(L12+zr)+COS(tr)*SIN(L13);
0▶HAngle;
I:=1;
FOR I FROM 1 TO 120 DO
atan2(L9(I),L10(I));
  CASE
    if L10(I)==0 AND L9(I)==0 then "undefined"; end;
    if L10(I)>0 then L14(I):=(atan(L9(I)/L10(I))/π*180)+zd; end; 
    if L10(I)<0 AND L9(I)>=0 then L14(I):=(atan(L9(I)/L10(I))/π*180)+180+zd; end;
    if L10(I)==0 AND L9(I)>0 then L14(I):=pi/2; end; 
    if L10(I)<0 AND L9(I)<=0 then L14(I):=(atan(L9(I)/L10(I))/π*180)-180+zd; end;
    if L10(I)==0 AND L9(I)<0 then L14(I):=-pi/2; end;
  END;
END;
1▶HAngle;
I:=1;
FOR I FROM 1 TO 120 DO
L15(I):=L14(I)-360*FLOOR(L14(I)/360)
END;
L16:=ASIN(L11)/π*180;
L17:=L16*π/180;
//PRINT("L17");
//PRINT(L17);
L18:=L15*π/180;
//PRINT("L18");
//PRINT(L18);
0▶HAngle;
L19:=SIN(epsr)*COS(L18)*npsir+SIN(L18)*nepsr;
//PRINT("L19");
//PRINT(L19);
L20:=(COS(epsr)+SIN(epsr)*SIN(L18)*TAN(L17))*npsir-COS(L18)*TAN(L17)*nepsr;
L21:=COS(L18)*COS(pr)*COS(epsr)+SIN(L18)*SIN(pr);
L22:=COS(L18)*COS(lsr)*COS(epsr)+SIN(L18)*SIN(lsr);
L23:=(ec*L21-L22)*.0000993650849745/COS(L17);
L24:=COS(pr)*COS(epsr)*(TAN(epsr)*COS(L17)-SIN(L18)*SIN(L17))+COS(L18)*SIN(L17)*SIN(pr);
L25:=COS(lsr)*COS(epsr)*(TAN(epsr)*COS(L17)-SIN(L18)*SIN(L17))+COS(L18)*SIN(L17)*SIN(lsr);
L26:=(ec*L24-L25)*.0000993650849745;
//PRINT("L26");
//PRINT(L26);
1▶HAngle;
L27:=(L23+L20+L18)/(π)*180;
//PRINT("L27");
//PRINT(L27);
L28:=360-L27;
L29:=((L26+L19+L17)/π)*180;
//PRINT("L29");
//PRINT(L29);
0▶HAngle;
L39:=gastd+L28-IP((gastd+L28)/360)*360;
L39:=L39*π/180;
//PRINT("L39");
//PRINT(L39);
LOCAL lol,lod,lom,los,lat,lad,lam,las;
F:=HMS→(F);//Lat
G:=HMS→(G);//Long

lod:=IP(G);
lom:=IP(FP(G)*60);
los:=IP(FP(FP(G)*60)*60);
lol:=los/3600+lom/60+lod;
lol:=lol*π/180;
//PRINT("Long");
//PRINT(lol);

lad:=IP(F);
lam:=IP(FP(F)*60);
las:=IP(FP(FP(F)*60)*60);
lat:=las/3600+lam/60+lad;
lat:=lat*π/180;
//PRINT("Lat");
//PRINT(lat);

//WAIT();
L40:=L39+lol;
//PRINT("L40");
//PRINT(L40);
L41:=L40/(π)*180;
//PRINT("L41");
//PRINT(L41);
L30:=L41-IP(L41/360)*360;
//PRINT("L30");
//PRINT(L30);
1▶HAngle;
L33:=L29*π/180;
//PRINT("L33");
//PRINT(L33);
0▶HAngle;
L36:=(SIN(L33)*SIN(lat)+COS(L33)*COS(lat)*COS(L40));
//PRINT("L36");
//PRINT(L36);
1▶HAngle;
L34:=ASIN(L36)*π/180;
//PRINT("L34");
//PRINT(L34);
//lat:=lat*π/180;
0▶HAngle;
L35:=(SIN(L33)-SIN(lat)*L36)/(COS(lat)*COS(L34));
//PRINT("L35");
//PRINT(L35);
1▶HAngle;
L31:=L34*180/π;
//PRINT("L31");
//PRINT(L31);
L37:=(ACOS(L35));
//PRINT("L37");
//PRINT(L37);
I:=1;
FOR I FROM 1 TO 120 DO
IF L30(I)>180 THEN
L38(I):=L37(I);
ELSE
L38(I):=360-L37(I);
END;
END;
LOCAL dip;
dip:=(-1.76*√(D)+.34*(A-B)-.2)/60;
L42:=((C-1010)*(1.0367/(1+.00367+A))+TAN(L31+7.31/(L31+4.4)))/60;
I:=1;
FOR I FROM 1 TO 120 DO
STARDAT.Cell(I,7):=L38(I);
STARDAT.Cell(I,8):=L31(I);
END;
//PRINT("L38");
//PRINT(L38);
//KILL;
//STARTVIEW(1);
PRINT();
LOCAL mag;
INPUT({mag},"Enter magnitude",{"Value 0-3 (Recomended 2)"});
RECT();
//LOCAL Xmin,Xmax,Ymin,Ymax;
LINE_P(0,90*2.43,360/1.125,90*2.43,RGB(255,0,225));
LINE_P(0,180*2.43,360/1.125,180*2.43,RGB(255,0,225));
LINE_P(180/1.125,0,180/1.125,180*2.43,RGB(255,0,0));
LINE_P(90/1.125,0,90/1.125,90*2.43,RGB(255,0,0));
LINE_P(270/1.125,0,270/1.125,219,RGB(255,0,0));
LINE_P(45/1.125,0,45/1.125,90*2.43,RGB(255,0,225));
LINE_P(135/1.125,0,135/1.125,219,RGB(255,0,225));
LINE_P(225/1.125,0,225/1.125,219,RGB(255,0,225));
LINE_P(315/1.125,0,315/1.125,90*2.43,RGB(255,0,225));
LINE_P(358/1.125,0,358/1.125,219,RGB(255,0,225));
TEXTOUT_P("AZYM",2,0,1);
TEXTOUT_P("45°",45/1.125,0,1);
TEXTOUT_P("90°",90/1.125,0,1);
TEXTOUT_P("135°",135/1.125,0,1);
TEXTOUT_P("180°",180/1.125,0,1);
TEXTOUT_P("225°",225/1.125,0,1);
TEXTOUT_P("270°",270/1.125,0,1);
TEXTOUT_P("315°",315/1.125,0,1);
LINE_P(0,15*2.43,360/1.125,15*2.43,RGB(255,0,225));
LINE_P(0,30*2.43,360/1.125,30*2.43,RGB(255,0,225));
LINE_P(0,45*2.43,360/1.125,45*2.43,RGB(255,0,225));
LINE_P(0,60*2.43,360/1.125,60*2.43,RGB(255,0,225));
LINE_P(0,75*2.43,360/1.125,75*2.43,RGB(255,0,225));
TEXTOUT_P("75°",0,15*2.43,1);
TEXTOUT_P("60°",0,30*2.43,1);
TEXTOUT_P("45°",0,45*2.43,1);
TEXTOUT_P("30°",0,60*2.43,1);
TEXTOUT_P("15°",0,75*2.43,1);
TEXTOUT_P("Hz",0,90*2.43,1);
I:=1;
FOR I FROM 1 TO 120 DO
IF (STARDAT.Cell(I,8))>0 AND (STARDAT.Cell(I,6))<mag THEN
PIXON_P((STARDAT.Cell(I,7)/1.125),220-(STARDAT.Cell(I,8)*2.43));
ARC_P((STARDAT.Cell(I,7)/1.125),220-(STARDAT.Cell(I,8)*2.43),(STARDAT.Cell(I,10))*2,2*π,RGB(255,0,255));
TEXTOUT_P((STARDAT.Cell(I,1)),(STARDAT.Cell(I,7)/1.125)-20,220-(STARDAT.Cell(I,8)*2.43)+3,1,RGB(0,0,255));
WAIT();
TEXTOUT_P((STARDAT.Cell(I,1)),(STARDAT.Cell(I,7)/1.125)-20,220-(STARDAT.Cell(I,8)*2.43)+3,1,RGB(255,255,255));
END;
END;
WAIT();
1▶I;
LOCAL NM,DD,L50:={},L51:={},L52:={};
LOCAL L53:={},L54:={},L55:={},L56:={};
LOCAL mnm,mns,hod,hom;
INPUT({NM},"Enter data",{"How many stars"});
FOR I FROM 1 TO NM DO
CHOOSE(DD,"Choose star",{"Acamar","Achernar","Acrux","Adhara","Albaldah","Albireo","Alcyone","Aldebaran","Alderamin","Algenib","Algieba","Algol","Algorab","Alhena","Alioth","Alkaid","Almaak","Alnair","Alnath","Alnilam","Alnitak","Alphard","Alphekka","Alpheratz","Altair","Aludra","Ankaa","Antares","Arcturus","Arneb","Atria","Avior","Becrux","Bellatrix","Betelgeuse","Canopus","Capella","Caph","Castor","Cebalrai","Cih","CorCaroli","Cursa","Deneb","Denebola","Diphda","Dschubba","Dubhe","Enif","Etamin","Fomalhaut","Gacrux","Gienah","GienahGhurab","Gomeisa","Graffias","Hadar","Hamal","Hassaleh","Hatsya","Izar","KausAustralis","KausBorealis","KausMeridionalis","Kochab","Kornephoros","Kraz","Markab","Matar","Menkalinan","Menkar","Menkent","Merak","Miaplacidus","Mintaka","Mirach","Mirphak","Mirzam","Mizar","Mufrid","Naos","Nash","Nihal","Nunki","Peacock","Phad","Phakt","Polaris","Pollux","Porrima","Procyon","RasElasedAustralis","Rasalgethi","Rasalhague","Rastaban","Regulus","Rigel","RigilKentaurus","Ruchbah","Sadalmelik","Sadalsuud","Sadr","Saiph","Sargas","Scheat","Shaula","Shedir","Sheratan","Sirius","Spica","Tarazed","Tureis","Unukalhai","Vega","Vindemiatrix","Wezen","Zaurak","Zosma","Zubenelgenubi"});
L50(I):=DD;
//END;
//FOR I FROM 1 TO NM DO
INPUT({mnm,mns,hod,hom},STARDATA.Cell(L50(I),1),{"Min of obs","Sec of obs","Ho deg°","Ho min'"});
L51(I):=(mns/3600)+(mnm/60);
L52(I):=hod+hom/60;
END;
//PRINT(L50);
I:=1;
FOR I FROM 1 TO NM DO
PRINT(STARDAT.Cell(L50(I),1));
END;
PRINT(L51);
PRINT(L52);
L42:=((C-1010)*(1.0367/(1+.00367+A))+TAN(L31+7.31/(31+4.4)))/60;
//PRINT("refr");
//PRINT(L42);


END;
Find all posts by this user
Quote this message in a reply
04-13-2020, 12:15 AM
Post: #2
RE: Astro and Astronawigational Program
Why would you ever try to override the reserved global variable names with exactly the same local names.
Use A1, B2, or AA, BB, or use lower case names because they aren't reserved.
And instead of using L1, L2, which are reserved for system wide lists use either LL1, LL1,
or önce again lowercase l1, l2,...
– –
VPN
PS: If everything else fails... read the Manual!
Find all posts by this user
Quote this message in a reply
04-13-2020, 06:28 AM
Post: #3
RE: Astro and Astronawigational Program
Good day.

OK. Above noted. Just hard to get old habits out from TI times.
Above program with full functionality I wrote already on TI89 titanium and works good.
So in fact I copied habits from TI.

Any clues on MOUSE event to choose object and load choice to List?
Find all posts by this user
Quote this message in a reply
04-13-2020, 07:52 AM
Post: #4
RE: Astro and Astronawigational Program
Good day.
I did not attached screens which are easier to show what are my intentions.
1. The present status on HP Prime
[Image: Screenshot-20200413-102836.jpg]
2. Another version with 1740 stars
[Image: Screenshot-20200413-102732.jpg]
3. Trials with Cartesian
[Image: 20200413-102643.jpg]
4. How it looks on TI89
[Image: 20200413-102558.jpg]
5. TI89 final LOP drawn (as intended on HP)
[Image: 20200331-203730.jpg]
Find all posts by this user
Quote this message in a reply
04-13-2020, 12:40 PM
Post: #5
RE: Astro and Astronawigational Program
(04-13-2020 12:15 AM)CyberAngel Wrote:  Why would you ever try to override the reserved global variable names with exactly the same local names.

I do it all the time when I don't want to disturb the global values of those variables.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
12-28-2020, 12:17 AM
Post: #6
RE: Astro and Astronawigational Program
Hello Darmuszka,

Any progress on this amazing program yet ?

I am very much interested in it.

Frank
Find all posts by this user
Quote this message in a reply
12-28-2020, 07:41 AM
Post: #7
RE: Astro and Astronawigational Program
Hi Frank.

No progres.
The program is completed and itself is working well to some extend. However the functionality to highlite the star by phone stylus for identification and then touch to add star to quene for further LOP calculation is not working.
At the end is working more or less the same way as on TI 89:
1. You have to take sextant sight of each star (height above horizon and rough azimuth)
2. In the program while giving all initial observation data the sky is displayed (You can manouver with magnitudo of stars)
3. Based I cannot add the star by touch You have only visual identification and You have to choose star for each LOP manually from list.
4. The drawing (plot) is not working yet. You will get only delta H and final Az for ech start.

At the end I found TI 89 much much more comprehensive and easier for programming and executing tastk I want. At this stage for daily astro sights I am using TI 89 only and HP as visual add help only.
Find all posts by this user
Quote this message in a reply
12-29-2020, 05:20 PM
Post: #8
RE: Astro and Astronawigational Program
Is there any fast way of translating the programs that are for TI Nspire for use in HP Prime, or do i have to manually rewrite the program?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)