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); }
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]; }
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]); }
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; }
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; }
public double getAyanamsa() { return sw.swe_get_ayanamsa_ut(sweDate.getJulDay()); }