swisseph
Class TCPlanet

java.lang.Object
  extended by swisseph.TransitCalculator
      extended by swisseph.TCPlanet

public class TCPlanet
extends TransitCalculator

This class implements a TransitCalculator for one planets position or speed.

You would create a TransitCalculator from this class and use the SwissEph.getTransit() methods to actually calculate a transit, e.g.:

 SwissEph sw = new SwissEph(...);
 ...
 int flags = SweConst.SEFLG_SWIEPH |
             SweConst.SEFLG_TRANSIT_LONGITUDE
             SweConst.SEFLG_TRANSIT_SPEED;
 boolean backwards = false;
 
 TransitCalculator tc = new TCPlanet(
                                  sw,
                                  SweConst.SE_SATURN,
                                  flags,
                                  0);
 ...
 double nextTransitET = sw.getTransitET(tc, jdET, backwards);
 
This would calculate the (ET-) date, when the Saturn will change from retrograde to direct movement or vice versa.


Field Summary
 
Fields inherited from class swisseph.TransitCalculator
rollover, rolloverVal
 
Constructor Summary
TCPlanet(SwissEph sw, int planet, int flags, double offset)
          Creates a new TransitCalculator for transits of any of the planets positions (longitudinal / latitudinal and distance) or speeds, be it in the geocentric or topocentric coordinate system, or in tropical or sidereal zodiac.
 
Method Summary
protected  double calc(double jdET)
           
protected  double getDegreePrecision(double jd)
           
protected  double getMaxSpeed()
           
protected  double getMinSpeed()
           
 java.lang.Object[] getObjectIdentifiers()
          This returns all the "object identifiers s" used in this TransitCalculator.
 double getOffset()
          This returns the degree or other value of the position or speed of the planet to transit.
 boolean getRollover()
           
protected  double getTimePrecision(double degPrec)
           
 void setOffset(double value)
          This sets the degree or other value for the position or speed of the planet to transit.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TCPlanet

public TCPlanet(SwissEph sw,
                int planet,
                int flags,
                double offset)
Creates a new TransitCalculator for transits of any of the planets positions (longitudinal / latitudinal and distance) or speeds, be it in the geocentric or topocentric coordinate system, or in tropical or sidereal zodiac.

Parameters:
sw - A SwissEph object, if you have one available. Can be null.
planet - The transiting planet. Valid planets are SweConst.SE_SUN up to SweConst.SE_INTP_PERG with the exception of SweConst.SE_EARTH.
flags - The calculation type flags (SweConst.SEFLG_TRANSIT_LONGITUDE, SweConst.SEFLG_TRANSIT_LATITUDE or SweConst.SEFLG_TRANSIT_DISTANCE in conjunction with SweConst.SEFLG_TRANSIT_SPEED for transits over a speed value). Also flags modifying the basic planet calculations, these are SweConst.SEFLG_TOPOCTR, SweConst.SEFLG_HELCTR and SweConst.SEFLG_SIDEREAL, plus the ephemeris flags SweConst.SEFLG_MOSEPH, SweConst.SEFLG_SWIEPH or plus the ephemeris flags SweConst.SEFLG_MOSEPH, SweConst.SEFLG_SWIEPH or SweConst.SEFLG_JPLEPH optionally.
offset - This is the desired transit degree or transit speed.
See Also:
TCPlanetPlanet.TCPlanetPlanet(SwissEph, int, int, int, double), SweConst.SEFLG_TRANSIT_LONGITUDE, SweConst.SEFLG_TRANSIT_LATITUDE, SweConst.SEFLG_TRANSIT_DISTANCE, SweConst.SEFLG_TRANSIT_SPEED, SweConst.SEFLG_YOGA_TRANSIT, SweConst.SEFLG_TOPOCTR, SweConst.SEFLG_HELCTR, SweConst.SEFLG_SIDEREAL, SweConst.SEFLG_MOSEPH, SweConst.SEFLG_SWIEPH, SweConst.SEFLG_JPLEPH
Method Detail

getRollover

public boolean getRollover()
Specified by:
getRollover in class TransitCalculator
Returns:
Returns true, if one position value is identical to another position value. E.g., 360 degree is identical to 0 degree in circular angles.
See Also:
TransitCalculator.rolloverVal

setOffset

public void setOffset(double value)
This sets the degree or other value for the position or speed of the planet to transit. It will be used on the next call to getTransit().

Specified by:
setOffset in class TransitCalculator
Parameters:
value - The desired offset value.
See Also:
getOffset()

getOffset

public double getOffset()
This returns the degree or other value of the position or speed of the planet to transit.

Specified by:
getOffset in class TransitCalculator
Returns:
The currently set offset value.
See Also:
setOffset(double)

getObjectIdentifiers

public java.lang.Object[] getObjectIdentifiers()
This returns all the "object identifiers s" used in this TransitCalculator. It may be the planet number or planet numbers, when calculating planets.

Overrides:
getObjectIdentifiers in class TransitCalculator
Returns:
An array of identifiers identifying the calculated objects.

calc

protected double calc(double jdET)
Specified by:
calc in class TransitCalculator

getMaxSpeed

protected double getMaxSpeed()
Specified by:
getMaxSpeed in class TransitCalculator

getMinSpeed

protected double getMinSpeed()
Specified by:
getMinSpeed in class TransitCalculator

getTimePrecision

protected double getTimePrecision(double degPrec)
Specified by:
getTimePrecision in class TransitCalculator

getDegreePrecision

protected double getDegreePrecision(double jd)
Specified by:
getDegreePrecision in class TransitCalculator

toString

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