Planetdance forum
Board index => Astrobasic => Topic started by: ABer on March 31, 2022, 09:09:00 PM
-
Hi there - I'd be grateful for any comments on the following code. I am working on script for Uranian astrologers that will be distributed outside Jean's main download. I need to get the directed solar arc positions of the eight trans-neptunian planets used by Alfred Witte. These are:
37 Cupido
38 Hades
39 Zeus
40 Kronos
41 Apollon
42 Admetos
43 Vulkanus
44 Poseidon
(from the getplanet function help).
Firstly the code gets the directed ('progressed') positions for the main PLANET array and moves them to an array called dirPlusTNPs which has 24 positions.
set(dirPlusTNPs, -1000); ` sets each of 24 positions in the array to -1000
` solar arc - horoscope #3
sethoroscopetime(3, jdDir, zone);
progression(0, 3, 1);
getplanets(3, saPlanet);
move(saPlanet, dirPlusTNPs, PLANETS * REAL);
Then using the getplanet function, the eight TNPs are put into an 8 x 6 array. The horoscope used is #3, the one calculated by the first progression function (progression(0, 3, 1).
` getplanet array
i = 0; for ( i < 8 )
getplanet(i + 37, 3, tnpDirOutput);
The third part of the code, moves the eight TNPs into the last eight positions in the dirPlusTNPs array based on identify those remaining positions that are occupied by the value -1000.
` put tnps into array, last eight positions are -1000
i = 0; for (i < 24){
if (dirPlusTNPs < -500)
dirPlusTNPs = tnpDirOutput[i - 16][0];}
The longitude position in the getplanet array is 0.
This works, in the sense that it runs, but it doesn't appear to identify the correct longitudes for the eight directed positions of the TNPs.
Does anybody have any advice on whether getplanet can be used for this purpose, or do I have to do something else, or is there an error in the code?
Thanks.
Ed
-
Will post tomorrow Ed!
-
Thanks Jean. Ed
-
You should store the results from getplanet() into an array, from you example it is not clear but later on it seems that tnpDirOutput is an array after all.
` getplanet array
i = 0; for ( i < 8 )
getplanet(i + 37, 3, tnpDirOutput[i]); ` <-- tnpDirOutput should be array
Maybe you had better send me that code after all, i have trouble understanding your issue.
-
Hi Jean - thanks for the feedback. I'm going to have another go at this. I've got a new idea. Ed
-
Maybe i should have mentioned, if you only need the lengths, you can do someting like
real lons[8], dummy[6];
i = 0; for (i < 8)
lons[i] = getplanet(i + 37, 3, dummy);
-
Hi Jean - I'd come to the same conclusion, here is a test file to look at. You will note that all planets are directed by solar arc by the same amount, but when it comes to the TNPs they don't seem to match. Not sure what's going on.
window(800, 600);
menu(0, "Close", close);
menu(0, "Help", NULL);
menu(2, "English", help);
menu(2, "Dutch", helpnl);
real planet[PLANETS], house[HOUSES], planetsPlus[24], saPlanet[PLANETS], dirPlusTNPsSA[24], hold[6], jd, lon, lat, r;
int time[6], i;
char inifile[256] = "xxx.ini", s[99];
@load;
onclose(save);
copyhoroscope(-1, 0);
getname(0, s);
setcaption(s);
gethoroscopetime(0, time, jd);
real zone = gethoroscopetimezone(0);
getlonlat(0, lon, lat);
getplanets(0, planet);
gethouses(0, house);
@go;
run;
:go;
visible(0);
fill(0, 0, width, height, -2);
move(planet, planetsPlus, PLANETS * REAL);
` getplanet array
i = 0; for (i < 8 ){
getplanet(i + 37, 3, hold);
r = hold[0];
planetsPlus[i + 16] = r;}
` solar arc - horoscope #3
sethoroscopetime(3, jd + 20000, zone);
progression(0, 3, 1);
getplanets(3, saPlanet);
move(saPlanet, dirPlusTNPsSA, PLANETS * REAL);
` getplanet array
i = 0; for (i < 8 ){
getplanet(i + 37, 3, hold);
r = hold[0];
dirPlusTNPsSA[i + 16] = r;}
i = 0; for (i < 24){
if (i < PLANETS)
putplanet(10, 10 + i * 20, i);
else
objectsymbol(10, 10 + i * 20, i + 5);
putrealnumber(40, 10 + i * 20, planetsPlus, 4);
putrealnumber(140, 10 + i * 20, dirPlusTNPsSA, 4);
` for solar arc this difference should be the same for all planets but it doesn't seem to be
r = normalize(dirPlusTNPsSA - planetsPlus);
putrealnumber(240, 10 + i * 20, r, 4);}
visible(1);
return;
:close;
quit;
:help;
help("Help ", "");
return;
:helpnl;
help("NL Help", "");
return;
:load;
fileopen(inifile, FILEREADAB);
fileread(time);
fileclose;
return;
:save;
fileopen(inifile, FILEWRITEAB);
filewrite(time);
fileclose;
return;
Ed
-
Hi Jean - this works now:
move(planet, planetsPlus, PLANETS * REAL);
` getplanet array
i = 0; for (i < 8 ){
getplanet(i + 37, 3, hold);
r = hold[0];
planetsPlus[i + 16] = r;}
` solar arc - horoscope #3
sethoroscopetime(3, jd + 20000, zone);
progression(0, 3, 1);
getplanets(3, saPlanet);
move(saPlanet, dirPlusTNPsSA, PLANETS * REAL);
` r = arc of sun
r = normalize(dirPlusTNPsSA[0] - planetsPlus[0]);
` add arc sun to original position of tnps
i = 0; for (i < 8 )
dirPlusTNPsSA[i + 16] = normalize(planetsPlus[i + 16] + r);
i = 0; for (i < 24){
if (i < PLANETS)
putplanet(10, 10 + i * 20, i);
else
objectsymbol(10, 10 + i * 20, i + 5);
putrealnumber(40, 10 + i * 20, planetsPlus, 4);
putrealnumber(140, 10 + i * 20, dirPlusTNPsSA, 4);
` for solar arc this difference should be the same for all planets
r = normalize(dirPlusTNPsSA - planetsPlus);
putrealnumber(240, 10 + i * 20, r, 4);}
-
I still get the error about [ expected on lines 52 to 56 in that code.
In stead of
i = 0; for (i < 8 ){
getplanet(i + 37, 3, hold);
r = hold[0];
planetsPlus[i + 16] = r;}
you could do
i = 0; for (i < 8 )
planetsPlus[i + 16] = getplanet(i + 37, 3, hold);
-
Thanks Jean - I'll take a look at it. Ed
-
I'm sure you will Ed. ;D 8)
-
Hi Jean - I've got it working, but the script needs a lot of sorting out. Overly complicated really. Ed
-
Why is that? I assume you are doing something with fictionals and progression?