AstroLib (Java library for astro charting calculations)

Summary

AstroLib is a 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. It is based on my Zodiac Watch, an astro-chart real-time watch applet. After putting the applet on my homepage, I got a lot of requests regarding its Java source. So I removed all painting and user interface routines to create a library.

Note that 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 taken from Astrolog and converted to Java. Part of the code is commented in German, but the variables' and methods' names are all English.

Installation

To install AstroLib, simply 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.

Usage

The library is used as shown in the Demo class' main method:

   // get a horoscop instance
   final 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 or output raw data
   System.out.println(horoscop.toString());

Packages

In case you want to add or change something, there are the following packages:

License Agreement

AstroLib is Open Source under the GPL license.

Version History