示例#1
0
  public void calcPlanetaryPosition(Set<Planet> planets) {

    planetPos = new EnumMap<Planet, Double>(Planet.class);

    isReverse = new EnumMap<Planet, Boolean>(Planet.class);

    double[] res = new double[6];
    StringBuffer sbErr = new StringBuffer();

    for (Planet planet : planets) {

      int rc =
          sw.swe_calc_ut(sweDate.getJulDay(), planet.planetNo(), AstroConsts.iflag, res, sbErr);
      planetPos.put(planet, res[0]);

      if ((res[3] < 0) && (!Planet.isNode(planet))) {

        isReverse.put(planet, true);
      }
    }

    // No-way to compute ketu pos from swisseph
    Double rahuPos = planetPos.get(Planet.Rahu);

    if (rahuPos != null) {
      double ketuPos = (rahuPos + 180.00) % 360;
      planetPos.put(Planet.Ketu, ketuPos);
    }
    // System.out.println(sbErr);
  }
示例#2
0
  public double getPlanetSpeed(Planet planet) {

    double[] res = new double[6];
    StringBuffer sbErr = new StringBuffer();
    sw.swe_calc_ut(sweDate.getJulDay(), planet.planetNo(), AstroConsts.iflag, res, sbErr);
    return res[3];
  }
示例#3
0
  public static double calcNatonnataBalaDeg(SweDate birthSD, double birthTime) {

    SwissEph sw = new SwissEph();

    // sw.swe_set_ephe_path("d\\:\\\\AstroSoft");
    double et = birthSD.getJulDay() + birthSD.getDeltaT();
    DblObj E = new DblObj();
    StringBuffer sbErr = new StringBuffer();
    int diff = sw.swe_time_equ(et, E, sbErr);
    double EqnOfTime = E.val * 24 * -1;
    double bTimeDeg = (birthTime + EqnOfTime) * 15;

    if (bTimeDeg > 180) {
      bTimeDeg = 360 - bTimeDeg;
    }
    return bTimeDeg;
  }
示例#4
0
  public Rasi getAscendant(double birthLong, double birthLat) {
    double[] ac = new double[10];
    double[] positions = new double[13];

    sw.swe_houses(
        sweDate.getJulDay(), HOUSE_FLAG, birthLat, birthLong, HOUSE_SYSTEM, positions, ac);

    return Rasi.ofDeg(positions[1]);
  }
示例#5
0
  public HousePosition calcHousePosition(double birthLong, double birthLat) {

    double[] ac = new double[10];
    double[] positions = new double[13];

    sw.swe_houses(
        sweDate.getJulDay(), HOUSE_FLAG, birthLat, birthLong, HOUSE_SYSTEM, positions, ac);

    // System.out.println()
    HousePosition housePosition = new HousePosition(positions);
    housePosition.setSiderealTime((double) (ac[2] / 15));

    return housePosition;
  }
示例#6
0
  public void setAyanamsa(Ayanamsa ayanamsa) {

    sw.swe_set_sid_mode(ayanamsa.ayaValue(), 0.0, 0.0);
    calcPlanetaryPosition();
  }
示例#7
0
 public SwissHelper() {
   sw = new SwissEph();
   sw.swe_set_sid_mode(AstroSoft.getPreferences().getAyanamsa().ayaValue(), 0.0, 0.0);
 }
示例#8
0
 public double getAyanamsa() {
   return sw.swe_get_ayanamsa_ut(sweDate.getJulDay());
 }