This is AstroLib
... a free Java library for astro charting calculations. There are house system and planet position calculation methods together with date/time and location conversion routines. For a given time the positions of the planets in the zodiac are calculated. There is no code for graphical representations or drawing a chart. The library contains just methods for calculating the data needed to build a chart. Some methods were simply ported from Walter 'Cruiser1' Pullen's Astrolog 5.40 (which is written in C) and converted to Java. Part of the code is commented in German, but variables and methods are all named in English.
The library is used as shown in the
Demo
class' main
method:// get a horoscop instanceIn case you want to add or change something, there are the following packages:
TextHoroscop horoscop = new TextHoroscop();
// set your desired planet position calculation algorithm
horoscop.setPlanet(new PlanetAA0());
// set your desired house system calculation algorithm
// may be anything from the at.kugel.zodiac.house package.
horoscop.setHouse(new HousePlacidus());
// set your user data time value
horoscop.setTime(1, 12, 1953, 20);
// set your user data location value
horoscop.setLocationDegree(-16 - 17.0/60, 48 + 4.0/60);
// calculate the values
horoscop.calcValues();
// do something with the data, e.g. output raw data
System.out.println(horoscop.toString());
- The main package contains the
TextHoroscop
class, which uses the house system and planet calculation classes to calculate the astro-chart data. util
contains some independent calculation utility functions and classes.planet
contains the different planet position calculation algorithms. This package is only dependent on the util package. All planet position algorithms are subclasses ofPlanetBasic
which itself implementsPlanetInt
. New and more accurate planet position algorithms must implementPlanetInt
and may wish to extendPlanetBasic
to inherit common functionality, but are not forced to do so. There is onlyPlanetAA0
available at the moment, which is not very accurate.house
contains the different house systems. All house system calculation algorithms are subclasses ofHouseBasic
which itself implementsHouseInt
.
Download AstroLib 1.13 (70 KB), together with source. Extract the astrolib-*.zip and add astrolib.jar to your classpath. AstroLib is JDK 1.1 compliant and does not depend on any other libraries. AstroLib is Open Source under the GPL license.
The library is not actively developed any more, in fact it never was. The last changes I made were adding the
Demo
class in 2004 and fixing a bug using time zones in 2005 (thanks to Rastislav Szabo for reporting it). Today I reformatted the code and fixed some warnings. That's it folks.FAQ
Q: Are there any chart drawing functions as in Zodiac Watch? A: Unfortunately the drawing routines are tightly coupled to the applet code and the browser user interface. I was able to extract the calculation routines and put them into a separate package, but this is not possible for the drawing code itself.
Q: The co-ordinates of the planets are within 1 minute difference from other available chart generation programs. But for the co-ordinates of the moon there is a 10 to 20 degree difference and the positions of the houses are absurd. What is wrong? A: Using a wrong time-zone results in a wrong local time. This affects the moon and the houses, but not the slower moving objects. Also make sure to enter negative longitude in the east zone and negative latitude below equator.
Q: Is there any code for computing the nodes of the moon? A: No, AstroLib can't do that.
Q: What kind of zodiac is calculated: Actual constellation divisions or the classic 30 degree each division? A: Traditional 30 degree per sign.