com.hedgehog.planets
Class AbstractPlanet

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.geo.GeometricObject
          extended by com.hedgehog.geo.threed.GeometricObject3D
              extended by com.hedgehog.geo.threed.shapes.Shape3D
                  extended by com.hedgehog.geo.threed.shapes.Sphere3D
                      extended by com.hedgehog.planets.AbstractPlanet
All Implemented Interfaces:
ModelObject, java.lang.Comparable, java.util.Comparator
Direct Known Subclasses:
Jupiter, Mars, Mercury, Neptune, Saturn, Uranus, Venus

public abstract class AbstractPlanet
extends Sphere3D

Title: AbstractPlanet - abstract base class for computing the position of a planet.

Description: Abstract base class of planet classes.

The calculations are based on J Meeus's excellent book "Astro Algos", 2nd ed, Willmann-Bell, 2005 and the tutorial documents by Paul Schlyter (www.stjarnhimlen.se).

AbstractPlanet extends Sphere3D and has subclasses Mercury, Venus, Mars, Jupiter, Saturn, Uranus and Neptune. Planet Earth extends from OblateSpheroid3D since more is known about the exact dimensions of Earth when compared to the other planets.

Copyright: Copyright (c) Hedgehog Software 2007-2009.

Company: Hedgehog Software

Since:
1.0
Version:
1.1

Field Summary
 
Fields inherited from class com.hedgehog.geo.threed.shapes.Sphere3D
mCentre, mRadius
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
AbstractPlanet()
          Default constructor.
AbstractPlanet(AbstractPlanet object)
          Copy constructor.
AbstractPlanet(Point3D centre, double radius)
          Constructor.
 
Method Summary
static double angleBetweenCelestialEclipticPoles(double obliquityEclipticDegrees, double eclipticLatitudeDegrees, double eclipticLongitudeDegrees)
          The angle between the direction of the northern celestial pole and the direction of the ecliptic of a star.
static double angleBetweenGreatCircleOS1S3AndLineOS2(RightAscensionDeclination radec1, RightAscensionDeclination radec2, RightAscensionDeclination radec3)
          Returns the angle between the great circle OS1S3 and line OS2.
static double angleBetweenGreatCirclesOS1S3AndOS2S3(RightAscensionDeclination radec1, RightAscensionDeclination radec2, RightAscensionDeclination radec3)
          Returns the angle between the two great circles OS1S3 and OS2S3.
static double angularSeparationBetweenTwoBodies(HoursMinutesSeconds ra1, DegreesMinutesSeconds dec1, HoursMinutesSeconds ra2, DegreesMinutesSeconds dec2)
          Returns the angular separation (in degrees) between the two specified bodies.
abstract  double apparentEquatorialDiameter(double radialDistanceAU)
          Returns the apparent diameter for the specified radial distance in AUs.
static PairDouble azimuthAltitudeToEquatorial(double azimuth, double altitude, double latitude)
          Calculates the equatorial coordinates.
static double bodiesInStraightLine(RightAscensionDeclination radec1, RightAscensionDeclination radec2, RightAscensionDeclination radec3)
          Tests whether or not 3 bodies are in a straight line; ie if they lie on the same great circle of the celestial sphere.
 double declination(int dayNumber)
          Returns the declination (Dec) at the specified day number in degrees.
static double diurnalAngle(double declinationDegrees, double latitudeDegrees)
          Returns the angle, J, of the diurnal path of a celestial body relative to the horizon at the time of its rising or setting.
 double eccentricAnomaly(int dayNumber, boolean in360Interval)
          Returns the eccentric anomaly in degrees, masked to [0:360] using normaliseDegrees().
abstract  double eccentricity(int dayNumber)
          Returns the eccentricity.
static double eclipticHorizonAngle(double obliquityEclipticDegrees, double latitudeDegrees, HoursMinutesSeconds localSiderealTime)
          Returns the angle I in degrees between the ecliptic and the horizon.
static PairDouble eclipticLatLongToEquatorialRADec(double ecl, double lat, double lon)
          Converts equatorial (lat,lon) coordinates to ecliptic (RA,Dec) coordinates.
static PairDouble eclipticPoints180Apart(double obliquityEclipticDegrees, double latitudeDegrees, HoursMinutesSeconds localSiderealTime)
          Returns the longitudes of two points of the ecliptic that are 180 degrees apart on the horizon.
static double equationOfTheCentre(double e, double M, boolean degrees)
          Returns the equation of the centre C, or the difference C=v-M, where v is the true anamoly and M is the mean anomaly.
static PairDouble equatoralRADecToEclipticLatLong(double ecl, double ra, double dec)
          Converts equatorial (RA,Dec) coordinates to ecliptic (lat,lon) coordinates.
static PairDouble equatorialToAzimuthAltitude(double H, double lat, double dec)
          Calculates the local horizontal coordinates.
 double geocentricDistance(int dayNumber)
          Returns the radial distance from the planet to the Earth's centre.
 double geocentricTimeDays(int dayNumber)
          Returns the time taken (in days) by light to reach Earth from the planet; ie 0.0057755183 * geocentricDistance().
 LatitudeLongitude geoLatitudeLongitude(int dayNumber)
          Converts the point returned by geoRectangularCoordinates() to geocentric (lat,lon) coordinates.
 Point3D geoRectangularCoordinates(int dayNumber)
          Returns the position of a planet wrt geocentric coordinates.
 Point3D geoRectangularEclipticCoordinates(int dayNumber)
          Converts the rectangular coordinates returned by geoRectangularCoordinates() to rectangular equatorial coordinates by rotating the (x,y,z) onto the yz-plane by the angle of the obliquity of the ecliptic.
 PairDouble helioLatLongPerturbations(int dayNumber)
          Heliocentric perturbations.
 PairDouble helioLatLongPerturbationsJupiter(int dayNumber)
          Heliocentric perturbations for Jupiter.
 PairDouble helioLatLongPerturbationsSaturn(int dayNumber)
          Heliocentric perturbations for Saturn.
 PairDouble helioLatLongPerturbationsUranus(int dayNumber)
          Heliocentric perturbations for Uranus.
 TripleDouble helioLatLongRadius(int dayNumber, boolean perturbationCorrection)
          Returns the heliocentric latitude(degrees), longitude(degrees) and radial distance(AU) of the planet at the specified day number.
 double helioRadialDistance(int dayNumber)
          Returns the radial distance from the Sun to the planet for the specified day number.
 Point3D helioRectangularCoordinates(int dayNumber)
          Returns the rectangular coordinates for the planet at the specified day number wrt heliocentric coordinate system.
 Point3D helioRectangularCoordinatesInEclipticCoordinates(int dayNumber)
          Returns the rectangular coordinates of the planet wrt the heliocentric ecliptic coordinate plane for the specified day number.
abstract  double inclination(int dayNumber)
          Returns the inclination (ie tilt) of the orbit relative to the ecliptic plane in degrees.
abstract  boolean isEarth()
          Tests whether or not this planet is Earth.
abstract  boolean isJupiter()
          Tests whether or not this planet is Jupiter.
abstract  boolean isMars()
          Tests whether or not this planet is Mars.
abstract  boolean isMercury()
          Tests whether or not this planet is Mercury.
abstract  boolean isNeptune()
          Tests whether or not this planet is Neptune.
abstract  boolean isSaturn()
          Tests whether or not this planet is Saturn.
abstract  boolean isUranus()
          Tests whether or not this planet is Uranus.
abstract  boolean isVenus()
          Tests whether or not this planet is Venus.
static HoursMinutesSeconds localHourAngle(HoursMinutesSeconds siderealTimeMean, double rightAscensionDegrees, double longitudeDegrees)
          Variant of localHourAngle() with the right ascension and longitude specified in degrees.
static HoursMinutesSeconds localHourAngle(HoursMinutesSeconds siderealTimeMean, HoursMinutesSeconds rightAscension, HoursMinutesSeconds longitude)
          Returns the local hour angle (H=theta-lon-ra) for the specified sidereal mean time (theta), right ascension (ra) and longitude (lon).
abstract  double longitudeOfAscendingNode(int dayNumber)
          Returns the longitude of ascending node for the specified day number in degrees.
abstract  double longitudeOfPerihelion(int dayNumber)
          Returns the longitude of perihelion in degrees.
abstract  double meanAnomaly(int dayNumber)
          Returns the mean anomaly in degrees.
abstract  double meanDistanceToEarth(int dayNumber, boolean au)
          Returns the mean distance/semi-major-axis to Earth in aus or actual distance in metres.
static double parallacticAngle(double latitudeDegrees, double decDegrees, double hourAngleDegrees)
          Returns the parallactic angle (q), which is the angle between celestial north of a planet and zenith.
static double radiusVector(double e, double M, double a, boolean degrees)
          Returns the radius vector centred at a foci for a given planet in terms of the specified eccentricity e and mean anomaly M.
 double rightAscension(int dayNumber)
          Returns the Right Ascension (RA) at the specified day number in degrees.
static HoursMinutesSeconds rightAscensionDegreesToTime(double raDegrees)
          Converts the right ascension in degrees to time by dividing by 15; ie 360/24.
static double rightAscensionTimeToDegrees(HoursMinutesSeconds raHMS)
          Converts right ascension in terms of time to degrees.
static TripleDouble riseTransitSetUT(HoursMinutesSeconds siderealTime, HoursMinutesSeconds raDMinus1, HoursMinutesSeconds raD, HoursMinutesSeconds raDPlus1, DegreesMinutesSeconds decDMinus1, DegreesMinutesSeconds decD, DegreesMinutesSeconds decDPlus1, LatitudeLongitude observer, double altitudeDegrees, boolean approximate)
          Computes the UT times.
static double smallestCircleDiameter(HoursMinutesSeconds ra1, DegreesMinutesSeconds dec1, HoursMinutesSeconds ra2, DegreesMinutesSeconds dec2, HoursMinutesSeconds ra3, DegreesMinutesSeconds dec3, HInteger type)
          Returns the diameter (in degrees) of te smallest enclosing circle of the 3 specified bodies.
 double trueAnomaly(int dayNumber, boolean in360Interval)
          Returns the true anomaly in degrees.
static double velocityAtAphelion(double e, double a)
          Returns the velocity (km/s) at aphelion of a moving body in an unperturbed elliptic orbit.
static double velocityAtPerihelion(double e, double a)
          Returns the velocity (km/s) at perihelion of a moving body in an unperturbed elliptic orbit.
static double velocityInEllipticOrbit(double r, double a)
          Returns the velocity (km/s) of a moving body in an unperturbed elliptic orbit.
 
Methods inherited from class com.hedgehog.geo.threed.shapes.Sphere3D
arcDistanceBetween, area, axisXPoint, axisXVector, axisYPoint, axisYVector, axisZPoint, axisZVector, boundingBox, centroid, childModelObjects, databaseInsertStatement, databaseUpdateStatement, diameter, diametricallyOppositePoint, distanceToSphere, enclosingSphere, enclosingSphereAverageCentre, equatorCircle, fromDatabase, fromXMLNode, furthestPoint, gaussCurvature, getCentre, getRadius, greatCircle, greatCircle, intersection, intersection, intersection, intersection, intersectionVolume, kissingNumber, latitude, longitude, meanCurvature, nearestPoint, northPole, outwardNormal, phiAndThetaFromPoint, pointInside, pointInsideOrOnSurface, pointOnSphere, pointOnSurface, pointOutside, randomPointsInsideSphere, randomPointsOnSphere, rotate, scale, setCentre, setRadius, southPole, sphereCircle, toQuadraticSurface3D, toString, toX3DNode, toXMLNode, transform, translate, volume, xValue, yValue, zValue
 
Methods inherited from class com.hedgehog.geo.threed.shapes.Shape3D
is2D, is3D, isCurve, isGrid, isMesh, isPoint, isPointSet, isShape, isSurface
 
Methods inherited from class com.hedgehog.geo.GeometricObject
objectDimension
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPlanet

public AbstractPlanet()
Default constructor. Sets the planet centre to (0,0,0) and the radius to unity.


AbstractPlanet

public AbstractPlanet(Point3D centre,
                      double radius)
Constructor. Sets the planet to the specified object.

Parameters:
centre - Planet centre.
radius - Planet radius.

AbstractPlanet

public AbstractPlanet(AbstractPlanet object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

eccentricAnomaly

public double eccentricAnomaly(int dayNumber,
                               boolean in360Interval)
Returns the eccentric anomaly in degrees, masked to [0:360] using normaliseDegrees().

Parameters:
dayNumber - The day number.
in360Interval - Specifies whether or not the returned angle is to be masked to the [0:360] range.
Returns:
The eccentric anomaly for the specified day number.

helioRectangularCoordinates

public Point3D helioRectangularCoordinates(int dayNumber)
Returns the rectangular coordinates for the planet at the specified day number wrt heliocentric coordinate system.

Parameters:
dayNumber - The day number.
Returns:
Position of the planet for the specified day number wrt heliocentric coordinate system.

helioRadialDistance

public double helioRadialDistance(int dayNumber)
Returns the radial distance from the Sun to the planet for the specified day number.

Parameters:
dayNumber - The day number.
Returns:
The radial distance from the Sun to the planet for the specified day number.

trueAnomaly

public double trueAnomaly(int dayNumber,
                          boolean in360Interval)
Returns the true anomaly in degrees.

Parameters:
dayNumber - The day number.
in360Interval - Specifies whether or not the returned angle is to be masked to the [0:360] interval.
Returns:
The true anomaly in degrees.

helioRectangularCoordinatesInEclipticCoordinates

public Point3D helioRectangularCoordinatesInEclipticCoordinates(int dayNumber)
Returns the rectangular coordinates of the planet wrt the heliocentric ecliptic coordinate plane for the specified day number.

Parameters:
dayNumber - The day number.
Returns:
Position of the Moon for the specified day number wrt the ecliptic coordinate plane.

helioLatLongRadius

public TripleDouble helioLatLongRadius(int dayNumber,
                                       boolean perturbationCorrection)
Returns the heliocentric latitude(degrees), longitude(degrees) and radial distance(AU) of the planet at the specified day number.

Parameters:
dayNumber - The day number.
perturbationCorrection - Specifies whether or not perturbations are to be appended to the calculated {latitude,longitude,radius} triple.
Returns:
The {lat,long,radius} triple at the specified day number.

helioLatLongPerturbations

public PairDouble helioLatLongPerturbations(int dayNumber)
Heliocentric perturbations. Caters for perturbations to Jupiter, Saturn and Uranus.

Parameters:
dayNumber - The day number.
Returns:
Pair perturbation pair.

helioLatLongPerturbationsJupiter

public PairDouble helioLatLongPerturbationsJupiter(int dayNumber)
Heliocentric perturbations for Jupiter.

Parameters:
dayNumber - The day number.
Returns:
Pair perturbation pair.

helioLatLongPerturbationsSaturn

public PairDouble helioLatLongPerturbationsSaturn(int dayNumber)
Heliocentric perturbations for Saturn.

Parameters:
dayNumber - The day number.
Returns:
Pair perturbation pair.

helioLatLongPerturbationsUranus

public PairDouble helioLatLongPerturbationsUranus(int dayNumber)
Heliocentric perturbations for Uranus.

Parameters:
dayNumber - The day number.
Returns:
Pair perturbation pair.

geoRectangularCoordinates

public Point3D geoRectangularCoordinates(int dayNumber)
Returns the position of a planet wrt geocentric coordinates. This is acheived by combining helioLatLongRadius() and the Sun's rectangularEclipticCoordinates(). For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p223 equ(33.1).

Parameters:
dayNumber - The day number.
Returns:
Position of the planet wrt geocentric coordinates.

geoRectangularEclipticCoordinates

public Point3D geoRectangularEclipticCoordinates(int dayNumber)
Converts the rectangular coordinates returned by geoRectangularCoordinates() to rectangular equatorial coordinates by rotating the (x,y,z) onto the yz-plane by the angle of the obliquity of the ecliptic.

Parameters:
dayNumber - The day number.
Returns:
Rectangular equatorial coordinates.

geoLatitudeLongitude

public LatitudeLongitude geoLatitudeLongitude(int dayNumber)
Converts the point returned by geoRectangularCoordinates() to geocentric (lat,lon) coordinates. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p223 equ(33.2).

Parameters:
dayNumber - The day number.
Returns:
The geocentric (lat,lon) coordinates of a planet at the specified day number.

rightAscension

public double rightAscension(int dayNumber)
Returns the Right Ascension (RA) at the specified day number in degrees.

Parameters:
dayNumber - The day number.
Returns:
The right ascension in degrees.

declination

public double declination(int dayNumber)
Returns the declination (Dec) at the specified day number in degrees.

Parameters:
dayNumber - The day number.
Returns:
The declination in degrees.

geocentricDistance

public double geocentricDistance(int dayNumber)
Returns the radial distance from the planet to the Earth's centre. Refer to Meeus "Astronomical Algorithms" 2nd ed, p224, equ(33.4).

Parameters:
dayNumber - The day number.
Returns:
The radial distance from the planet to the Earth's centre.

geocentricTimeDays

public double geocentricTimeDays(int dayNumber)
Returns the time taken (in days) by light to reach Earth from the planet; ie 0.0057755183 * geocentricDistance(). Refer to Meeus "Astronomical Algorithms" 2nd ed, p224, equ(33.3).

Parameters:
dayNumber - The day number.
Returns:
Time taken (in days) to reach Earth from the planet.

equatoralRADecToEclipticLatLong

public static PairDouble equatoralRADecToEclipticLatLong(double ecl,
                                                         double ra,
                                                         double dec)
Converts equatorial (RA,Dec) coordinates to ecliptic (lat,lon) coordinates. The longitude is masked to the [0:360] range using rev(). All angles are in degrees. This method is the inverse of eclipticLatLongToEquatorialRADec(). Refer to Meeus "Astronomical Algorithms" 2nd ed, p93.

Parameters:
ecl - The obliquity of ecliptic angle in degrees; ie for Earth 23.4393 - 3.563e-07*dayNumber.
ra - Right Ascension in degrees.
dec - Declination in degrees
Returns:
Returns the pair, with both angles in degrees.
See Also:
eclipticLatLongToEquatorialRADec(double, double, double)

eclipticLatLongToEquatorialRADec

public static PairDouble eclipticLatLongToEquatorialRADec(double ecl,
                                                          double lat,
                                                          double lon)
Converts equatorial (lat,lon) coordinates to ecliptic (RA,Dec) coordinates. All angles are in degrees. This method is the inverse of equatoralRADecToEclipticLatLong(). Refer to Meeus "Astronomical Algorithms" 2nd ed, p93.

Parameters:
ecl - The obliquity of ecliptic angle in degrees; ie for Earth 23.4393 - 3.563e-07*dayNumber.
lat - Latitude in degrees.
lon - Longitude in dgerees.
Returns:
Returns the pair, with both angles in degrees. The RA is masked to the [0:360] range using revDegrees.
See Also:
equatoralRADecToEclipticLatLong(double, double, double)

equatorialToAzimuthAltitude

public static PairDouble equatorialToAzimuthAltitude(double H,
                                                     double lat,
                                                     double dec)
Calculates the local horizontal coordinates. Converts local hour angle (H), declination (dec) and ltitude (lat) to the pair. All angles are in degrees. Note account is made for the of atmospheric refraction on altitude h. This method is the inverse of azimuthAltitudeToEquatorial(). Refer to Meeus "Astronomical Algorithms" 2nd ed, p93.

Parameters:
H - Local hour angle in degrees.
lat - Latitude in degrees.
dec - Declination in degrees.
Returns:
Returns the pair in degrees.
See Also:
azimuthAltitudeToEquatorial(double, double, double)

azimuthAltitudeToEquatorial

public static PairDouble azimuthAltitudeToEquatorial(double azimuth,
                                                     double altitude,
                                                     double latitude)
Calculates the equatorial coordinates. Converts local horizontal coordinates azimuth and altitude at the specified latitude to the local hour angle and declination pair All angles are in degrees. This method is the inverse of equatorialToAzimuthAltitude(). Refer to Meeus "Astronomical Algorithms" 2nd ed, p94.

Parameters:
azimuth - Azimuth in degrees.
altitude - Altitude in degrees.
latitude - Latitude in degrees.
Returns:
Returns the pair in degrees.
See Also:
equatorialToAzimuthAltitude(double, double, double)

localHourAngle

public static HoursMinutesSeconds localHourAngle(HoursMinutesSeconds siderealTimeMean,
                                                 HoursMinutesSeconds rightAscension,
                                                 HoursMinutesSeconds longitude)
Returns the local hour angle (H=theta-lon-ra) for the specified sidereal mean time (theta), right ascension (ra) and longitude (lon).

Parameters:
siderealTimeMean - Sidereal mean time.
rightAscension - Right ascension.
longitude - Longitude.
Returns:
local hour angle.

localHourAngle

public static HoursMinutesSeconds localHourAngle(HoursMinutesSeconds siderealTimeMean,
                                                 double rightAscensionDegrees,
                                                 double longitudeDegrees)
Variant of localHourAngle() with the right ascension and longitude specified in degrees.

Parameters:
siderealTimeMean - Sidereal mean time.
rightAscensionDegrees - Right ascension in degrees.
longitudeDegrees - Longitude in degrees.
Returns:
The local hour angle.

rightAscensionDegreesToTime

public static HoursMinutesSeconds rightAscensionDegreesToTime(double raDegrees)
Converts the right ascension in degrees to time by dividing by 15; ie 360/24.

Parameters:
raDegrees - Right ascension in degrees.
Returns:
Right ascension in terms of time.
See Also:
rightAscensionTimeToDegrees(com.hedgehog.date_time.HoursMinutesSeconds)

rightAscensionTimeToDegrees

public static double rightAscensionTimeToDegrees(HoursMinutesSeconds raHMS)
Converts right ascension in terms of time to degrees.

Parameters:
raHMS - Right ascension in time.
Returns:
Right ascension in terms of degrees.
See Also:
rightAscensionDegreesToTime(double)

parallacticAngle

public static double parallacticAngle(double latitudeDegrees,
                                      double decDegrees,
                                      double hourAngleDegrees)
                               throws java.lang.IllegalArgumentException
Returns the parallactic angle (q), which is the angle between celestial north of a planet and zenith. For further details refer to "Astro Algos", 2nd ed, J Meeus, p98, eq(14.1).

Parameters:
latitudeDegrees -
decDegrees -
hourAngleDegrees -
Returns:
The parallactic angle (q) in degrees.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified triple (lat,dec,h) do not define q, ie the celestial body is exactly in the zenith.

eclipticPoints180Apart

public static PairDouble eclipticPoints180Apart(double obliquityEclipticDegrees,
                                                double latitudeDegrees,
                                                HoursMinutesSeconds localSiderealTime)
Returns the longitudes of two points of the ecliptic that are 180 degrees apart on the horizon. For further details refer to "Astro Algos", 2nd ed, J Meeus, p99, eq(14.2).

Parameters:
obliquityEclipticDegrees - Obliquity of the ecliptic, epsilon, in degrees.
latitudeDegrees - Observer latitude in degrees.
localSiderealTime - Local sidereal time in (h,m,s).
Returns:
A pair od ecliptic points that are 180 degrees apart.

eclipticHorizonAngle

public static double eclipticHorizonAngle(double obliquityEclipticDegrees,
                                          double latitudeDegrees,
                                          HoursMinutesSeconds localSiderealTime)
Returns the angle I in degrees between the ecliptic and the horizon. For further details refer to "Astro Algos", 2nd ed, J Meeus, p99, eq(14.3).

Parameters:
obliquityEclipticDegrees - Obliquity of the ecliptic, epsilon, in degrees.
latitudeDegrees - Observer latitude in degrees.
localSiderealTime - Local sidereal time in (h,m,s).
Returns:
A pair od ecliptic points that are 180 degrees apart.

angleBetweenCelestialEclipticPoles

public static double angleBetweenCelestialEclipticPoles(double obliquityEclipticDegrees,
                                                        double eclipticLatitudeDegrees,
                                                        double eclipticLongitudeDegrees)
The angle between the direction of the northern celestial pole and the direction of the ecliptic of a star. For further details refer to "Astro Algos", 2nd ed, J Meeus, p100.

Parameters:
obliquityEclipticDegrees - Obliquity of the ecliptic, epsilon, in degrees.
eclipticLatitudeDegrees - Ecliptical latitude in degrees.
eclipticLongitudeDegrees - Ecliptical longitude in degrees.
Returns:
The angle between the direction of the northern celestial pole and the direction of the ecliptic of a star.

diurnalAngle

public static double diurnalAngle(double declinationDegrees,
                                  double latitudeDegrees)
Returns the angle, J, of the diurnal path of a celestial body relative to the horizon at the time of its rising or setting. J is computed from tanJ=Ccos(dec)/tan(lat), where C=sqrt(1-B^2), where B=tan(dec)tan(lat). Neglecting the declination (setting dec=0 degrees) then J is approximately equal to 90-lat, and is a general rule that the diurnal angle when a celestial body crosses the horizon is approximately equal to 90-lat. At the equator, bodies cross perpendicular to the horizon, while at the north pole bodies pass parallel to th horizon. For further details refer to "Astro Algos", 2nd ed, J Meeus, p100.

Parameters:
declinationDegrees - Declination in degrees.
latitudeDegrees - Oberserver latitude in degrees.
Returns:
Angle J if the diurnal path.

riseTransitSetUT

public static TripleDouble riseTransitSetUT(HoursMinutesSeconds siderealTime,
                                            HoursMinutesSeconds raDMinus1,
                                            HoursMinutesSeconds raD,
                                            HoursMinutesSeconds raDPlus1,
                                            DegreesMinutesSeconds decDMinus1,
                                            DegreesMinutesSeconds decD,
                                            DegreesMinutesSeconds decDPlus1,
                                            LatitudeLongitude observer,
                                            double altitudeDegrees,
                                            boolean approximate)
                                     throws java.lang.IllegalArgumentException
Computes the UT times. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 15.

Parameters:
siderealTime - Sidereal time.
raDMinus1 - Right ascension before the key day.
raD - Right ascension before on the key day.
raDPlus1 - Right ascension after the key day.
decDMinus1 - Declination before the key day.
decD - Declination on the key day.
decDPlus1 - Declination after the key day.
observer - Observer's latitude and longitude.
altitudeDegrees - The required altitude of the star/planet/sun; eg RiseSetAltitudes.STAR_PLANET_ALTITUDE.
approximate - Specifies whether an approximate (true) or more exact (false) is returned.
Returns:
UT triple.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified comibation of arguments means that the celestial body is either below or above the horizon throuhgout the entire day.

angularSeparationBetweenTwoBodies

public static double angularSeparationBetweenTwoBodies(HoursMinutesSeconds ra1,
                                                       DegreesMinutesSeconds dec1,
                                                       HoursMinutesSeconds ra2,
                                                       DegreesMinutesSeconds dec2)
Returns the angular separation (in degrees) between the two specified bodies. Supports a correction for small angles of separation using Meeus's equ(17.2). For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 17, equations (17.1) and (17.2).

Parameters:
ra1 - Right ascension of body 1.
dec1 - Declination of body 1.
ra2 - Right ascension of body 2.
dec2 - Declination of body 2.
Returns:
Angular separation between bodies 1 and 2 in degrees.
See Also:
Earth.distanceBetweenTwoPointsAlongSurface(com.hedgehog.utility.LatitudeLongitude, com.hedgehog.utility.LatitudeLongitude, int)

bodiesInStraightLine

public static double bodiesInStraightLine(RightAscensionDeclination radec1,
                                          RightAscensionDeclination radec2,
                                          RightAscensionDeclination radec3)
Tests whether or not 3 bodies are in a straight line; ie if they lie on the same great circle of the celestial sphere. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 19, p121, equ (19.1). For an example refer to BodiesInStraightLineSample.

Parameters:
radec1 - Right ascension - declination of body 1.
radec2 - Right ascension - declination of body 2.
radec3 - Right ascension - declination of body 3.
Returns:
Evaluation of function tan(d1)sin(ra2-ra3) + tan(d2)sin(ra3-ra1) + tan(d3)sin(ra1-ra2). If this value is equal to 0 then the 3 bodies are on a straight line, else they are not.

angleBetweenGreatCirclesOS1S3AndOS2S3

public static double angleBetweenGreatCirclesOS1S3AndOS2S3(RightAscensionDeclination radec1,
                                                           RightAscensionDeclination radec2,
                                                           RightAscensionDeclination radec3)
                                                    throws java.lang.IllegalArgumentException
Returns the angle between the two great circles OS1S3 and OS2S3. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 19, p121-125. The method used is the angle between the great circle planes. For an example refer to BodiesInStraightLineSample.

Parameters:
radec1 - Right ascension - declination of body 1.
radec2 - Right ascension - declination of body 2.
radec3 - Right ascension - declination of body 3.
Returns:
Angle (in degrees) between the 2 great circles formed by the specified 3 bodies.
Throws:
java.lang.IllegalArgumentException - Thrown if any of the declinations of the 3 arguments are outside the range [-90:90] degrees.

angleBetweenGreatCircleOS1S3AndLineOS2

public static double angleBetweenGreatCircleOS1S3AndLineOS2(RightAscensionDeclination radec1,
                                                            RightAscensionDeclination radec2,
                                                            RightAscensionDeclination radec3)
                                                     throws java.lang.IllegalArgumentException
Returns the angle between the great circle OS1S3 and line OS2. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 19, p121-125. The method used is the angle between the great circle plane and straight line. For an example refer to BodiesInStraightLineSample.

Parameters:
radec1 - Right ascension - declination of body 1.
radec2 - Right ascension - declination of body 2.
radec3 - Right ascension - declination of body 3.
Returns:
Angle (in degrees) between the great circle OS1S3 and line OS2 formed by the specified 3 bodies.
Throws:
java.lang.IllegalArgumentException - Thrown if any of the declinations of the 3 arguments are outside the range [-90:90] degrees.

smallestCircleDiameter

public static double smallestCircleDiameter(HoursMinutesSeconds ra1,
                                            DegreesMinutesSeconds dec1,
                                            HoursMinutesSeconds ra2,
                                            DegreesMinutesSeconds dec2,
                                            HoursMinutesSeconds ra3,
                                            DegreesMinutesSeconds dec3,
                                            HInteger type)
                                     throws java.lang.IllegalArgumentException
Returns the diameter (in degrees) of te smallest enclosing circle of the 3 specified bodies. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 20, p127. For an example refer to SmallestCircleSample.

Parameters:
ra1 - Right ascension of body 1.
dec1 - Declination of body 1.
ra2 - Right ascension of body 2.
dec2 - Declination of body 2.
ra3 - Right ascension of body 3.
dec3 - Declination of body 3.
type - Set upon return to the type of enclosing circle: 1(longest triangle side equal to the diameter) or 2(circle passing through through 3 points)
Returns:
Diameter of smallest enclosng circle.
Throws:
java.lang.IllegalArgumentException

equationOfTheCentre

public static double equationOfTheCentre(double e,
                                         double M,
                                         boolean degrees)
Returns the equation of the centre C, or the difference C=v-M, where v is the true anamoly and M is the mean anomaly. It is evaluated from the eccentricity e and M. Thus, if e and M are known then C=v-M and v=C+M. The equation is only valid provided that e is small. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p237.

Parameters:
e - Eccentricity.
M - Mean anomaly.
degrees - Specifies whether or not M is in degrees or radians.
Returns:
The equation of centre, C. If degrees is true then C is in radians, else if degrees is false then C is in radians; thus being consistent with M.

radiusVector

public static double radiusVector(double e,
                                  double M,
                                  double a,
                                  boolean degrees)
Returns the radius vector centred at a foci for a given planet in terms of the specified eccentricity e and mean anomaly M. The equation is only valid provided that e is small. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p237.

Parameters:
e - Eccentricity.
M - Mean anomaly.
a - Semi-major orbit axis of the planet.
degrees - Specifies whether or not M is in degrees or radians.
Returns:
Radius vector.

velocityInEllipticOrbit

public static double velocityInEllipticOrbit(double r,
                                             double a)
Returns the velocity (km/s) of a moving body in an unperturbed elliptic orbit. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p238. For an example refer to VelocitySample.

Parameters:
r - Distance of body to Sun. In Au units.
a - Semi-major axais of the body orbit. In AU units.
Returns:
The velocity in km/s.

velocityAtPerihelion

public static double velocityAtPerihelion(double e,
                                          double a)
Returns the velocity (km/s) at perihelion of a moving body in an unperturbed elliptic orbit. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p238. For an example refer to VelocitySample.

Parameters:
e - Oribital eccentricity.
a - Semi-major axais of the body orbit. In AU units.
Returns:
The velocity in km/s at perihelion.

velocityAtAphelion

public static double velocityAtAphelion(double e,
                                        double a)
Returns the velocity (km/s) at aphelion of a moving body in an unperturbed elliptic orbit. For further details refer to "Astro Algos", 2nd ed, J Meeus, chapter 33, p238. For an example refer to VelocitySample.

Parameters:
e - Oribital eccentricity.
a - Semi-major axais of the body orbit. In AU units.
Returns:
The velocity in km/s at aphelion.

eccentricity

public abstract double eccentricity(int dayNumber)
Returns the eccentricity.

Parameters:
dayNumber - The day number.
Returns:
The eccentricity.

inclination

public abstract double inclination(int dayNumber)
Returns the inclination (ie tilt) of the orbit relative to the ecliptic plane in degrees.

Parameters:
dayNumber - The day number.
Returns:
Inclination in degrees.

longitudeOfAscendingNode

public abstract double longitudeOfAscendingNode(int dayNumber)
Returns the longitude of ascending node for the specified day number in degrees.

Parameters:
dayNumber - The day number.
Returns:
The longitude of ascending node in degrees.

longitudeOfPerihelion

public abstract double longitudeOfPerihelion(int dayNumber)
Returns the longitude of perihelion in degrees. The perihelion is defined as the point on the orbit that is closest to the Sun.

Parameters:
dayNumber - The day number.
Returns:
The longitude of perihelion in degrees.

meanAnomaly

public abstract double meanAnomaly(int dayNumber)
Returns the mean anomaly in degrees.

Parameters:
dayNumber - The day number.
Returns:
The mean anomaly in degrees.

meanDistanceToEarth

public abstract double meanDistanceToEarth(int dayNumber,
                                           boolean au)
Returns the mean distance/semi-major-axis to Earth in aus or actual distance in metres.

Parameters:
dayNumber - The day number.
au - Specifies whether the returned distance is in AUs or actual distance in metres.
Returns:
The mean distance to Earth.

apparentEquatorialDiameter

public abstract double apparentEquatorialDiameter(double radialDistanceAU)
                                           throws java.lang.IllegalArgumentException
Returns the apparent diameter for the specified radial distance in AUs. The apparent diameter for 1AU of the Earth from the Sun is 17.59secs or 0.004886degs.

Parameters:
radialDistanceAU - Radial distance in AUs.
Returns:
The apparent diameter for the specified radial distance (AUs). The returned value is in degrees.
Throws:
java.lang.IllegalArgumentException - Thrown if radialDistanceAU<=0.

isMercury

public abstract boolean isMercury()
Tests whether or not this planet is Mercury.

Returns:
Logical-true if this planet is Mercury, else logical-false.

isVenus

public abstract boolean isVenus()
Tests whether or not this planet is Venus.

Returns:
Logical-true if this planet is Benus, else logical-false.

isEarth

public abstract boolean isEarth()
Tests whether or not this planet is Earth.

Returns:
Logical-true if this planet is Earth, else logical-false.

isMars

public abstract boolean isMars()
Tests whether or not this planet is Mars.

Returns:
Logical-true if this planet is Mars, else logical-false.

isJupiter

public abstract boolean isJupiter()
Tests whether or not this planet is Jupiter.

Returns:
Logical-true if this planet is Jupiter, else logical-false.

isSaturn

public abstract boolean isSaturn()
Tests whether or not this planet is Saturn.

Returns:
Logical-true if this planet is Saturn, else logical-false.

isUranus

public abstract boolean isUranus()
Tests whether or not this planet is Uranus.

Returns:
Logical-true if this planet is Uranus, else logical-false.

isNeptune

public abstract boolean isNeptune()
Tests whether or not this planet is Neptune.

Returns:
Logical-true if this planet is Neptune, else logical-false.