net.grelf.astro
Class SkyPoint

java.lang.Object
  extended by net.grelf.astro.SkyPoint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SkyPoint
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Representing a celestial position by equatorial coordinates (RA and Dec) for a given Epoch.

See Also:
Serialized Form

Field Summary
protected  double x
          Equatorial coordinates for unit radius, held to avoid computing them more than once.
protected  double y
          Equatorial coordinates for unit radius, held to avoid computing them more than once.
protected  double z
          Equatorial coordinates for unit radius, held to avoid computing them more than once.
 
Constructor Summary
SkyPoint(RA ra, Dec dec, Epoch equinox)
           
 
Method Summary
 double[] calculateRiseTransitSet(JulianDate jd, BodyKind kind, Angle latitude)
          Returns an array of 3 fractions of a day, representing respectively the local times of rising, transit and setting for the given latitude and refraction offset (h0 = -0.5667 for stars and planets, -0.8333 for the Sun, +0.125 for the Moon).
 SkyVector calculateSeparation(SkyPoint other)
          Calculate position angle (PA) and spherical separation from this to another SkyPoint.
 void changeEquinox(Epoch newEquinox)
          This adjusts the fields of the current object to the given new epoch, high accuracy version.
 void changeEquinoxLowAccuracy(Epoch newEquinox)
          This adjusts the fields of the current object to the given new equinox, low accuracy version.
 SkyPoint clone()
          Returns a new SkyPoint object with the same data.
 boolean equals(java.lang.Object other)
           
 Dec getDec()
           
 Epoch getEpoch()
          Deprecated. 
 Epoch getEquinox()
           
 RA getRA()
           
 int hashCode()
          Enable objects of this class to be used as hash keys.
 java.lang.String toString()
           
 java.lang.StringBuffer toXML()
          Return elements.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected double x
Equatorial coordinates for unit radius, held to avoid computing them more than once.


y

protected double y
Equatorial coordinates for unit radius, held to avoid computing them more than once.


z

protected double z
Equatorial coordinates for unit radius, held to avoid computing them more than once.

Constructor Detail

SkyPoint

public SkyPoint(RA ra,
                Dec dec,
                Epoch equinox)
Method Detail

getRA

public RA getRA()

getDec

public Dec getDec()

getEpoch

@Deprecated
public Epoch getEpoch()
Deprecated. 

Deprecated: name changed to getEquinox.


getEquinox

public Epoch getEquinox()

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Enable objects of this class to be used as hash keys.

Overrides:
hashCode in class java.lang.Object

clone

public SkyPoint clone()
Returns a new SkyPoint object with the same data.

Overrides:
clone in class java.lang.Object

changeEquinoxLowAccuracy

public void changeEquinoxLowAccuracy(Epoch newEquinox)
This adjusts the fields of the current object to the given new equinox, low accuracy version. Uses the approximate formulae:
Annual precession in RA = 3.0730 + 1.3362.sin(RA).tan(Dec) seconds of time
Annual precession in Dec = 20.043.cos(RA) seconds of arc.


changeEquinox

public void changeEquinox(Epoch newEquinox)
This adjusts the fields of the current object to the given new epoch, high accuracy version. Uses the method given in Astronomical Algorithms by Jean Meeus (2nd edition, corrected Aug 09), Chapter 21 (Precession), the section headed "Rigorous method".


calculateSeparation

public SkyVector calculateSeparation(SkyPoint other)
Calculate position angle (PA) and spherical separation from this to another SkyPoint. If the other SkyPoint is for a different equinox it is first precessed to the equinox of this point.
Method is as given in Chapter 17 of Astronomical Algorithms by Jan Meeus, the algorithm supplied by Thierry Pauwels.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toXML

public java.lang.StringBuffer toXML()
Return elements.


calculateRiseTransitSet

public double[] calculateRiseTransitSet(JulianDate jd,
                                        BodyKind kind,
                                        Angle latitude)
Returns an array of 3 fractions of a day, representing respectively the local times of rising, transit and setting for the given latitude and refraction offset (h0 = -0.5667 for stars and planets, -0.8333 for the Sun, +0.125 for the Moon). Uses the method in J.Meeus "Astronomical Algorithms" (2nd Edn), Chapter 15. The JD for which these are required is NOT assumed to be for 0h UT - any JD is adjusted as necessary. The rising and setting times are set to -1.0 if the point is circumpolar at the given latitude.