giboow / mooncalc

JavaScript library for calculating moon position, phases and zodiac sign
BSD 3-Clause "New" or "Revised" License
39 stars 8 forks source link

Constellation and Zodiac are not the same #2

Open vicesalles opened 8 years ago

vicesalles commented 8 years ago

You did a great job calculating the moon's zodiac for a given day but zodiac and constellation are not the same thing. For example, today: Date 2016-09-27T07:31:23.226Z the zodiac is, as you calculated Leo but the constellation is actually Cancer

gre commented 7 years ago

I'm wondering if this is due to the fact it only support day precision. when doing that: https://github.com/giboow/mooncalc/blob/master/mooncalc.js#L36-L38 it does not extract the remaining seconds of the day, so 2016-09-27T07:31:23.226Z is same as asking 2016-09-27T00:00:00.000Z .

@giboow do you know how to support a smaller granularity? I was thinking that in this formula: https://github.com/giboow/mooncalc/blob/master/mooncalc.js#L51 it could be something like :

dayExtraRatio = (((date.getHours()*60+date.getMinutes())*60+date.getSeconds())*1000+date.getMilliseconds()) / (24*60*60*1000);
jd = k1 + k2 + day + 59 + dayExtraRatio;
gre commented 7 years ago

probably not. there is something wrong in the formula. it does not match what I can find in http://www.rustica.fr/jardiner-avec-la-lune/ for instance. is that universal whatever your position on earth is?

giboow commented 7 years ago

No, I think I have forget the latitude and longitude parameter. The main function must take in parameters the UTC date, latitude and longitude

Nikola-Obreshkov commented 5 years ago

I think the current version is correctly calculating in which constellation the moon is in but not in which astrological sign. The both are different things. Do you know from the moon ecliptic longitude how can I calculate the zodiac sign in which the moon is not the constellation?

shawnlauzon commented 4 years ago

Yes, I believe this is displaying constellation and not zodiac, which are different. For example, look at the dates for the moon's ingress and compare with the result from the module:

{
  date: { year: 2020, month: 4, day: 5 },
  age: 12.252542423921003,
  distance: 361002.67988284124,
  ecliptic: { latitude: 4.791179957445516, longitude: 159.08458603675138 },
  phase: 'Waxing gibbous',
  trajectory: 'ascendent',
  constellation: 'Leo'
}

The site says that on April 4th the moon enters Virgo but mooncalc returns Leo as the constellation.