You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The objects and methods above make it look like you have used the SwissEph.java code (a Java port of the original C library). Unfortunately those are not part of the original code and are not available in this Javascript binding.
Calculation of lunar days
Greetings.
I've done this before in Java, here is a piece of code
public static double[] moon_Rise(SwissEph sw, SweDate sd, double lat, double lon, double tzOffset) { double[] md; ArrayList<Double> moondays = new ArrayList(); if (sw == null) { sw = new SwissEph("./ephe"); } double date = sd.getJulDay(); sd.makeValidDate(); int fl = SweConst.SEFLG_SWIEPH | SweConst.SEFLG_TRANSIT_LONGITUDE; TransitCalculator tc = new TCPlanetPlanet( sw, SweConst.SE_MOON, SweConst.SE_SUN, fl, 0); boolean backwards = true; double previousTransitUT = sw.getTransitUT(tc, sd.getJulDay(), backwards);//forward double nextTransitUT = sw.getTransitUT(tc, sd.getJulDay(), false);//forward int pl = SweConst.SE_MOON; fl = SweConst.SEFLG_SWIEPH | SweConst.SEFLG_TRANSIT_LONGITUDE | SweConst.SEFLG_TRANSIT_SPEED; int rsmi = 0; double[] geopos = {lon, lat, 0}; DblObj tret = new DblObj(); StringBuffer serr = new StringBuffer(); date = previousTransitUT; moondays.add(previousTransitUT); double monday = sd.getJulDay(); while (date < nextTransitUT) { sw.swe_rise_trans(date, pl, null, fl, SweConst.SE_CALC_RISE, geopos, 0, 0, tret, serr); monday = tret.val + 0.1; if (date > tret.val) { continue; } if (nextTransitUT < tret.val) { break; } moondays.add(tret.val); sw.swe_rise_trans(sd.getJulDay(), pl, null, fl, SweConst.SE_CALC_SET, geopos, 0, 0, tret, serr); date = monday; } moondays.add(nextTransitUT); md = new double[moondays.size()]; for (int i = 0; i < md.length; i++) { md[i] = moondays.get(i); } return md; }
Can you tell me how to do this in Javascript, the same Transit calculator, the previous aspect, the next aspect?
The text was updated successfully, but these errors were encountered: