Package org.hermit.astro

A library of astronomical calculations, providing positions, rise and set times, magnitudes, and other information for the Sun, Moon and planets.

See:
          Description

Interface Summary
AstroConstants Definitions of useful global constants related to astronomical calculations.
 

Class Summary
Body A celestial body in astronomical calculations; this class calculates and caches all parameters relating to a specific body.
Instant A representation of a particular moment in time, with methods to convert between the numerous time systems used in astronomy.
Moon This class represents the Moon, and provides all known information about it.
Observation This class represents a particular set of circumstances for a calculation, for example at a particular location and moment in time.
Planet This class represents a planet, and provides all known information about it.
Sun This class represents the Sun, and provides all known information about it.
Util This class contains an implementation of Meeus' interpolation methods.
 

Enum Summary
Body.Field This enumeration defines the data fields that are stored for each body.
Body.Name This enumeration defines the celestial bodies we know about.
Observation.OField This enumeration defines the data fields that are stored for each body.
 

Exception Summary
AstroError This exception is used to indicate an invalid request from the caller.
CalcError This exception represents an error within the Astro package; i.e.
 

Package org.hermit.astro Description

A library of astronomical calculations, providing positions, rise and set times, magnitudes, and other information for the Sun, Moon and planets. The code is based on "Astronomical Algorithms", by Jean Meeus, ISBN-10: 0-943396-61-1. Implemented directly in Java by Ian Cameron Smith.

The key class is Observation. It's used like this:

The Observation and Body computes the requested data on demand. However, the data is cached, so that if it is referred to from multiple places (which is often true in the internal calculations), it is only calculated once. Changing the circumstances of the observation (position, time, etc.) automatically clears all cached data.

See the On Watch application for an example of how it can be used.