swisseph
Class SwissLib

java.lang.Object
  extended by swisseph.SwissLib

public class SwissLib
extends java.lang.Object

This class offers many routines that might be interesting to a programmer.

One important note: in all this package, negative longitudes are considered to be west of Greenwich, positive longitudes are seen as east of Greenwich. Especially America often uses a different notation!

Probably most interesting are the functions swe_sidtime() (calculate the sidereal time) and swe_degnorm() (normalize a position to the range of 0.0 <= x < 360.0) and others.


Constructor Summary
SwissLib()
           
SwissLib(SwissData swed)
           
 
Method Summary
static double atof(java.lang.String src)
          This method emulates the C version of atof() allowing any string to be parsed into a number.
static int atoi(java.lang.String src)
          This method emulates the C version of atoi() allowing any string to be parsed into an integer.
 double square_sum(double[] x)
           
 double square_sum(double[] x, int offset)
           
 void swe_cotrans_sp(double[] xpo, double[] xpn, double eps)
           
 void swe_cotrans(double[] xpo, double[] xpn, double eps)
           
 void swe_cotrans(double[] xpo, int oOffs, double[] xpn, int nOffs, double eps)
           
 int swe_d2l(double x)
          double to int32 with rounding, no overflow check
 double swe_deg_midp(double x1, double x0)
           
 double swe_degnorm(double x)
          Normalizes a double to the range of 0.0 >= x < 360.0.
 double swe_difdeg2n(double p1, double p2)
          This calculates the difference of the two angles p1, p2 and normalizes them to a range of -180.0 <= x < 180.0 degrees.
 double swe_difrad2n(double p1, double p2)
           
 double swe_rad_midp(double x1, double x0)
           
 double swe_radnorm(double x)
          Normalizes a double to the range 0.0 >= x < 2*PI.
 double swe_sidtime(double tjd_ut)
          This calculates the sidereal time from a Julian day number.
 double swe_sidtime0(double tjd, double eps, double nut)
          This calculates the sidereal time from a Julian day number, the obliquity of the eclipse and the nutation (in degrees).
 void swe_split_deg(double ddeg, int roundflag, IntObj ideg, IntObj imin, IntObj isec, DblObj dsecfr, IntObj isgn)
          function for splitting centiseconds into * ideg degrees, imin minutes, isec seconds, dsecfr fraction of seconds isgn zodiac sign number; or +/- sign
 double swi_angnorm(double x)
           
 void swi_cartpol_sp(double[] x, double[] l)
           
 void swi_cartpol_sp(double[] x, int xOffs, double[] l, int lOffs)
           
 void swi_cartpol(double[] x, double[] l)
           
 void swi_cartpol(double[] x, int xOffs, double[] l, int lOffs)
           
 void swi_coortrf(double[] xpo, double[] xpn, double eps)
           
 void swi_coortrf(double[] xpo, int oOffs, double[] xpn, int nOffs, double eps)
           
 void swi_coortrf2(double[] xpo, double[] xpn, double sineps, double coseps)
           
 void swi_coortrf2(double[] xpo, int oOffs, double[] xpn, int nOffs, double sineps, double coseps)
           
 void swi_cross_prod(double[] a, int aOffs, double[] b, int bOffs, double[] x, int xOffs)
           
 int swi_cutstr(java.lang.String s, java.lang.String cutlist, java.lang.String[] cpos, int nmax)
          Cut the String s at any character in cutlist and put the resulting Strings into String cpos[].
 double swi_dot_prod_unit(double[] x, double[] y)
           
 double swi_echeb(double x, double[] coef, int offs, int ncf)
           
 double swi_edcheb(double x, double[] coef, int offs, int ncf)
           
 double swi_epsiln(double J)
           
 void swi_FK4_FK5(double[] xp, double tjd)
           
 void swi_FK5_FK4(double[] xp, double tjd)
           
 java.lang.String swi_gen_filename(SweDate sd, int ipli)
           
 double swi_kepler(double E, double M, double ecce)
           
 double swi_mod2PI(double x)
           
 void swi_polcart_sp(double[] l, double[] x)
           
 void swi_polcart_sp(double[] l, int lOffs, double[] x, int xOffs)
           
 void swi_polcart(double[] l, double[] x)
           
 void swi_polcart(double[] l, int lOffs, double[] x, int xOffs)
           
 int swi_precess(double[] R, double J, int direction)
           
 int swi_precess(double[] R, int rOffs, double J, int direction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwissLib

public SwissLib()

SwissLib

public SwissLib(SwissData swed)
Method Detail

square_sum

public double square_sum(double[] x)

square_sum

public double square_sum(double[] x,
                         int offset)

swe_degnorm

public double swe_degnorm(double x)
Normalizes a double to the range of 0.0 >= x < 360.0.


swe_radnorm

public double swe_radnorm(double x)
Normalizes a double to the range 0.0 >= x < 2*PI.


swe_deg_midp

public double swe_deg_midp(double x1,
                           double x0)

swe_rad_midp

public double swe_rad_midp(double x1,
                           double x0)

swi_mod2PI

public double swi_mod2PI(double x)

swi_angnorm

public double swi_angnorm(double x)

swi_cross_prod

public void swi_cross_prod(double[] a,
                           int aOffs,
                           double[] b,
                           int bOffs,
                           double[] x,
                           int xOffs)

swi_echeb

public double swi_echeb(double x,
                        double[] coef,
                        int offs,
                        int ncf)

swi_edcheb

public double swi_edcheb(double x,
                         double[] coef,
                         int offs,
                         int ncf)

swe_cotrans

public void swe_cotrans(double[] xpo,
                        double[] xpn,
                        double eps)

swe_cotrans

public void swe_cotrans(double[] xpo,
                        int oOffs,
                        double[] xpn,
                        int nOffs,
                        double eps)

swe_cotrans_sp

public void swe_cotrans_sp(double[] xpo,
                           double[] xpn,
                           double eps)

swi_coortrf

public void swi_coortrf(double[] xpo,
                        double[] xpn,
                        double eps)

swi_coortrf

public void swi_coortrf(double[] xpo,
                        int oOffs,
                        double[] xpn,
                        int nOffs,
                        double eps)

swi_coortrf2

public void swi_coortrf2(double[] xpo,
                         double[] xpn,
                         double sineps,
                         double coseps)

swi_coortrf2

public void swi_coortrf2(double[] xpo,
                         int oOffs,
                         double[] xpn,
                         int nOffs,
                         double sineps,
                         double coseps)

swi_cartpol

public void swi_cartpol(double[] x,
                        double[] l)

swi_cartpol

public void swi_cartpol(double[] x,
                        int xOffs,
                        double[] l,
                        int lOffs)

swi_polcart

public void swi_polcart(double[] l,
                        double[] x)

swi_polcart

public void swi_polcart(double[] l,
                        int lOffs,
                        double[] x,
                        int xOffs)

swi_cartpol_sp

public void swi_cartpol_sp(double[] x,
                           double[] l)

swi_cartpol_sp

public void swi_cartpol_sp(double[] x,
                           int xOffs,
                           double[] l,
                           int lOffs)

swi_polcart_sp

public void swi_polcart_sp(double[] l,
                           double[] x)

swi_polcart_sp

public void swi_polcart_sp(double[] l,
                           int lOffs,
                           double[] x,
                           int xOffs)

swi_dot_prod_unit

public double swi_dot_prod_unit(double[] x,
                                double[] y)

swi_epsiln

public double swi_epsiln(double J)

swi_precess

public int swi_precess(double[] R,
                       double J,
                       int direction)

swi_precess

public int swi_precess(double[] R,
                       int rOffs,
                       double J,
                       int direction)

swi_cutstr

public int swi_cutstr(java.lang.String s,
                      java.lang.String cutlist,
                      java.lang.String[] cpos,
                      int nmax)
Cut the String s at any character in cutlist and put the resulting Strings into String cpos[].

Parameters:
s - The input string.
cutlist - A String specifying all characters, where the input string should be cut.
cpos - Input and output paramater: a String[] containing maximum 'nmax' Strings.
nmax - The size of the cpos array. A relict from the C version...
Returns:
Number of generated Strings

swe_sidtime0

public double swe_sidtime0(double tjd,
                           double eps,
                           double nut)
This calculates the sidereal time from a Julian day number, the obliquity of the eclipse and the nutation (in degrees). You might want to use swe_sidtime(double), if you have just the Julian day number available.

Parameters:
tjd - The Julian day number
eps - Obliquity of the ecliptic
nut - Nutation in degrees
Returns:
Sidereal time in degrees.
See Also:
swe_sidtime(double)

swe_sidtime

public double swe_sidtime(double tjd_ut)
This calculates the sidereal time from a Julian day number.

Parameters:
tjd_ut - The Julian day number (in UT)
Returns:
Sidereal time in degrees.
See Also:
swe_sidtime0(double, double, double)

swi_gen_filename

public java.lang.String swi_gen_filename(SweDate sd,
                                         int ipli)

swe_split_deg

public void swe_split_deg(double ddeg,
                          int roundflag,
                          IntObj ideg,
                          IntObj imin,
                          IntObj isec,
                          DblObj dsecfr,
                          IntObj isgn)
function for splitting centiseconds into * ideg degrees, imin minutes, isec seconds, dsecfr fraction of seconds isgn zodiac sign number; or +/- sign


swi_kepler

public double swi_kepler(double E,
                         double M,
                         double ecce)

swi_FK4_FK5

public void swi_FK4_FK5(double[] xp,
                        double tjd)

swi_FK5_FK4

public void swi_FK5_FK4(double[] xp,
                        double tjd)

swe_d2l

public int swe_d2l(double x)
double to int32 with rounding, no overflow check


swe_difdeg2n

public double swe_difdeg2n(double p1,
                           double p2)
This calculates the difference of the two angles p1, p2 and normalizes them to a range of -180.0 <= x < 180.0 degrees.

Parameters:
p1 - The angle of point 1
p2 - The angle of point 2
Returns:
The normalized difference between p1, p2

swe_difrad2n

public double swe_difrad2n(double p1,
                           double p2)

atof

public static double atof(java.lang.String src)
This method emulates the C version of atof() allowing any string to be parsed into a number.


atoi

public static int atoi(java.lang.String src)
This method emulates the C version of atoi() allowing any string to be parsed into an integer.