public class SwissLib
extends java.lang.Object
implements java.io.Serializable
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DPSI_DEPS_IAU1980_FILE_EOPC04 |
static java.lang.String |
DPSI_DEPS_IAU1980_FILE_FINALS |
static double |
DPSI_DEPS_IAU1980_TJD0_HORIZONS |
static double |
HORIZONS_TJD0_DPSI_DEPS_IAU1980 |
Modifier and Type | Method and Description |
---|---|
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)
Round double to integer; negative double will get rounded as: - Math.abs(x)
|
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.
|
void |
swe_set_astro_models(int[] imodel) |
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)
Method to split centiseconds into:
ideg degrees,
imin minutes,
isec seconds,
dsecfr fraction of seconds
isgn zodiac sign number;
|
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) |
void |
swi_FK4_FK5(double[] xp,
double tjd) |
void |
swi_FK5_FK4(double[] xp,
double tjd) |
static java.lang.String |
swi_gen_filename(double jd,
int ipli) |
static 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) |
public static final java.lang.String DPSI_DEPS_IAU1980_FILE_EOPC04
public static final java.lang.String DPSI_DEPS_IAU1980_FILE_FINALS
public static final double DPSI_DEPS_IAU1980_TJD0_HORIZONS
public static final double HORIZONS_TJD0_DPSI_DEPS_IAU1980
public SwissLib()
public SwissLib(SwissData swed)
public double square_sum(double[] x)
public double square_sum(double[] x, int offset)
public double swe_degnorm(double x)
x
- input doublepublic double swe_radnorm(double x)
x
- input doublepublic double swe_deg_midp(double x1, double x0)
public double swe_rad_midp(double x1, double x0)
public double swi_mod2PI(double x)
public double swi_angnorm(double x)
public void swi_cross_prod(double[] a, int aOffs, double[] b, int bOffs, double[] x, int xOffs)
public double swi_echeb(double x, double[] coef, int offs, int ncf)
public double swi_edcheb(double x, double[] coef, int offs, int ncf)
public void swe_cotrans(double[] xpo, double[] xpn, double eps)
public void swe_cotrans(double[] xpo, int oOffs, double[] xpn, int nOffs, double eps)
public void swe_cotrans_sp(double[] xpo, double[] xpn, double eps)
public void swi_coortrf(double[] xpo, double[] xpn, double eps)
public void swi_coortrf(double[] xpo, int oOffs, double[] xpn, int nOffs, double eps)
public void swi_coortrf2(double[] xpo, double[] xpn, double sineps, double coseps)
public void swi_coortrf2(double[] xpo, int oOffs, double[] xpn, int nOffs, double sineps, double coseps)
public void swi_cartpol(double[] x, double[] l)
public void swi_cartpol(double[] x, int xOffs, double[] l, int lOffs)
public void swi_polcart(double[] l, double[] x)
public void swi_polcart(double[] l, int lOffs, double[] x, int xOffs)
public void swi_cartpol_sp(double[] x, double[] l)
public void swi_cartpol_sp(double[] x, int xOffs, double[] l, int lOffs)
public void swi_polcart_sp(double[] l, double[] x)
public void swi_polcart_sp(double[] l, int lOffs, double[] x, int xOffs)
public double swi_dot_prod_unit(double[] x, double[] y)
public int swi_cutstr(java.lang.String s, java.lang.String cutlist, java.lang.String[] cpos, int nmax)
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...public double swe_sidtime0(double tjd, double eps, double nut)
tjd
- The Julian day numbereps
- Obliquity of the eclipticnut
- Nutation in degreesswe_sidtime(double)
public double swe_sidtime(double tjd_ut)
tjd_ut
- The Julian day number (in UT)swe_sidtime0(double, double, double)
public static java.lang.String swi_gen_filename(SweDate sd, int ipli)
public static java.lang.String swi_gen_filename(double jd, int ipli)
public void swe_split_deg(double ddeg, int roundflag, IntObj ideg, IntObj imin, IntObj isec, DblObj dsecfr, IntObj isgn)
ideg degrees, imin minutes, isec seconds, dsecfr fraction of seconds isgn zodiac sign number;
ddeg
- Input value in centisecondsroundflag
- Flag for rounding, one of [SweConst.SE_SPLIT_DEG_ROUND_DEG | SweConst.SE_SPLIT_DEG_ROUND_MIN | SweConst.SE_SPLIT_DEG_ROUND_SEC] in combination with [SweConst.SE_SPLIT_DEG_KEEP_DEG | SweConst.SE_SPLIT_DEG_KEEP_SIGN | SweConst.SE_SPLIT_DEG_ZODIACAL]ideg
- Output value, degreeimin
- Output value, minutesisec
- Output value, secondsdsecfr
- Output value, fraction of secondsisgn
- Output value, sign of valueSweConst.SE_SPLIT_DEG_ROUND_DEG
,
SweConst.SE_SPLIT_DEG_ROUND_MIN
,
SweConst.SE_SPLIT_DEG_ROUND_SEC
,
SweConst.SE_SPLIT_DEG_KEEP_DEG
,
SweConst.SE_SPLIT_DEG_ZODIACAL
public double swi_kepler(double E, double M, double ecce)
public void swe_set_astro_models(int[] imodel)
public void swi_FK4_FK5(double[] xp, double tjd)
public void swi_FK5_FK4(double[] xp, double tjd)
public int swe_d2l(double x)
x
- The double value to round to an integerpublic double swe_difdeg2n(double p1, double p2)
p1
- The angle of point 1p2
- The angle of point 2public double swe_difrad2n(double p1, double p2)
public static double atof(java.lang.String src)
src
- String to parse to a doublepublic static int atoi(java.lang.String src)
src
- String to parse to an integer