|
Agena v. 7.8.6 (12/8/2026, Alexander Walz) |
Readme/What's new |
agena >>
`The Power of Procedural Programming`
7.8.6 Phobos, August 12, 2026
- New `astro.searchmoonphase` calculate the exact time a specific lunar phase occurs, from a given starting point.
Examples for two succeeeding Full Moons:
> import astro;
> astro.searchmoonphase(limit = -40, longitude = 180): # search backward
2461251.1094261 [2026, 7, 29, 14, 36, 19.011207818985]
> astro.searchmoonphase(2461252, limit = 40, longitude = 180): # search forward
2461280.6808049 [2026, 8, 28, 4, 19, 6.085461974144]
> astro.searchmoonphase([2026, 7, 30, 12, 0, 0], limit = 40, longitude = 180): # dito
2461280.6808049, [2026, 8, 28, 4, 19, 6.085461974144]
- New `astro.searchplanetapsis` finds the very next occurring Perihelion (the point in a planet's orbit closest to the Sun)
or Aphelion (the point furthest from the Sun) relative to a given starting date and time. Examples:
> import astro;
Search for the next event for the ninth planet:
> astro.searchplanetapsis('Pluto', [2026, 8, 11, 12, 0, 0]):
2114 2 20 10 45 39.279797673225 aphelion 49.32025774638 2493232.9483713
And the event after that:
> astro.searchplanetapsis('Pluto', 2493233):
2237 9 16 17 1 52.103931605816 perihelion 29.645264444715 2538366.2096308
- New `astro.searchlunarapsis` finds the very next occurring Lunar Apogee (the point in the Moon's orbit furthest from Earth)
or Lunar Perigee (the point closest to Earth) relative to a given starting date and time.
> import astro;
Search for the next event from the current date:
> L := [astro.searchlunarapsis()]:
[2026, 8, 22, 8, 20, 46.747706830502, apogee, 404632.01214081, 2461274.8477633]
Search for the event after that:
> astro.searchlunarapsis(L[9]):
2026 9 6 20 44 8.9950999617577 perigee 368248.59424929 2461290.363993
- New `astro.lunarlibration` calculates the lunar libration (apparent physical `wobble`) and sub-Earth tracking coordinates
of the Moon for a specific moment.
- New `astro.illumination` calculates the apparent brightness, illuminated surface area percentage, and phase geometry
of a celestial body as seen from Earth at a specific moment. For Saturn, it also returns the tilt angle of its ring system.
> astro.illumination('Moon', [2026, 8, 28, 4, 19, 6.085461974144]):
[fraction ~ 0.99998342840944, magnitude ~ -12.647142713872, phaseangle ~ 0.46648311109478]
- You can now pass year, month, day and time (UTC) as individual arguments to `astro.peak` which searches for the date and
time Venus will next appear brightest
- If no argument is given to `astro.moonphase` then the current date and hour is taken to compute the result. The function
alternatively accepts the Julian Date instead of a Gregorian date.
- `astro.searchalt` has been renamed to `astro.searchaltitude` and the function now returns the Julian Date of the event
as a first result and the corresponding Gregorian date as a table as the second result. You may have to change your code.
> import astro;
> astro.searchaltitude('Sun', 31.7683, 35.2137, 754.0, 2026, 8, 15, 12, 0, 0, -8.5, -1):
2461268.2091674 [2026, 8, 15, 17, 1, 12.062306106091]
The function also alternatively takes a Julian Date instead of a Gregorian date, so the following two statements are
equivalent:
> astro.searchaltitude('Sun', 31.7683, 35.2137, 754.0, 2461268, -8.5, -1):
2461268.2091674 [2026, 8, 15, 17, 1, 12.062306106091]
> astro.searchaltitude('Sun', 31.7683, 35.2137, 754.0, 2026, 8, 15, 12, 0, 0, -8.5, -1):
2461268.2091674 [2026, 8, 15, 17, 1, 12.062306106091]
- `astro.jdate` has been patched to properly process fractional seconds and to properly acknowledge milliseconds. |
|
Run Agena Scripts Easily (rase) v. 7.8.6 (12/8/2026, Alexander Walz) |
Readme/What's new |
rase - Run Agena Scripts Easily in Windows NT 4.0 or later and in OS/2.
Please refer to the explanations in `example.agn`.
For a quick demo, unpack all the files into a new, fresh directory, change into this directory and run the `example.exe` file
in an command shell (Windows) or `example.cmd` (OS/2) as follows:
example 1 2
There is also a utility called `whereis` which searches for a file in a path:
whereis /r /a "agena.*" c:/agena
Another one prints drive information:
drive c:
A script printing information on installed memory:
memory
Finally, cpuinfo prints various information on the CPU:
cpuinfo /a
In your operating system, you may want to add the path to the rase directory to your PATH system environment variable.
Credit: The implementation is based on https://www.cs.usfca.edu/~galles/cs420/lecture/LuaLectures/LuaAndC.html,
written by: Associate Professor David Galles, Department of Computer Science, University of San Francisco, CA 94117.
For compilation hints, check the top of the rase.c source file.
----------------------------------------------------------------
# READ.ME and DEMO Run Agena Scripts Easily (rase) for Windows
/*
This file shows how to execute Agena scripts in Windows NT 4.0 and later without passing the script and its arguments
to the actual Agena interpreter.
We won't call "agena example.agn 1 2" from the commandline, but just enter "example 1 2" in the NT shell.
In OS/2 we use the batch script example.cmd to execute a script.
Please make sure that the following files are now in one and the same directory:
example.agn (or your favourite script filename)
example.exe (Windows only, or your favourite executable filename)
agena.exe (in OS/2 only)
agena.dll (do not change the filename)
library.agn (do not change the filename)
libgcc_s_dw2-1.dll (Windows only, do not change the filename)
libmingwex-4.dll (Windoes only, do not change the filename)
In Windows, rename the following files in this ZIP file to your favourite name:
example.exe -> yourfavouritename.exe
example.agn -> yourfavouritename.agn
In OS/2, rename the following files in this ZIP file to your favourite name:
example.cmd -> yourfavouritename.cmd
example.agn -> yourfavouritename.agn
and edit the *.agn file according to your need. The *.exe or *.cmd file will launch your *.agn script file of the same name.
For a more elobarate script that locates files, links or folders in a directory, check the `whereis.agn` script.
For a script that prints drive information, check the `drive.agn` script. */
print('\nDemo using NO explicit function by referring to the \`args\' table:');
print('-----------------------------------------------------------------\n');
print('Number of arguments:', size(args));
# all arguments (all strings )are available in the args table, including the name of the script at index 1
print('Arguments passed: ', args);
# we convert the command-line arguments to numbers
local x, y := tonumber(args[2]), tonumber(args[3]);
if x :: number and y :: number then
print('Test: ', x & ' minus ' & y & ' is ' & (x - y));
print('Test: ', 'sqrt(' & x & ' + ' & y & ') is ' & sqrt(x + y))
fi;
/* In Windows, we _alternatively_ define a function of the same name as the executable
(w/o the file suffix, `example` in this case). This function will then be called
by the executable `example.exe`.
Just enter the following statement in an NT shell (cmd.com) and see what will happen:
example 1 2
*/
example := proc(?) is # this function will be automatically called by the executable
print('\nDemo using explicit function of same name \& \`nargs\' and the \`varargs\' table:');
print('----------------------------------------------------------------------------\n');
print('Number of arguments:', nargs);
print('Arguments passed: ', ?);
local x, y := tonumber(?[1]), tonumber(?[2]);
if x :: number and y :: number then
print('Test: ', x & ' minus ' & y & ' is ' & (x - y));
print('Test: ', 'sqrt(' & x & ' + ' & y & ') is ' & sqrt(x + y))
fi
end;
/* The output should be:
C:\agena\extract>example 1 2
Demo using NO explicit function by referring to the `args' table:
-----------------------------------------------------------------
Number of arguments: 3
Arguments passed: [example, 1, 2]
Test: 1 minus 2 is -1
Test: sqrt(1 + 2) is 1.7320508075689
Demo using explicit function of same name & `nargs' and the `varargs' table:
----------------------------------------------------------------------------
Number of arguments: 3
Arguments passed: [example, 1, 2]
Test: 1 minus 2 is -1
Test: sqrt(1 + 2) is 1.7320508075689
*/
|
Commenti
Alexander Walz
Sab, 13/05/2017 - 20:06
Collegamento permanente
Hello,
Aggiungi un commento