Qalculate / libqalculate

Qalculate! library and CLI
https://qalculate.github.io/
GNU General Public License v2.0
1.73k stars 142 forks source link

nextlunarphase doesn't work, calculate button does only insert! #183

Closed permaBox closed 4 years ago

permaBox commented 4 years ago

Hi, I have to report some issues around lunar functions ...

Many thanks for the nice calculator, keep going!

hanna-kn commented 4 years ago

Fixed.

permaBox commented 4 years ago

Hi, just one forgotten comment, nextlunarphase mentioned that phase can be 0<=p<1 BUT that means, 1=fullmoon would be excluded - right?! Does this make sense? I don't think so! May be just the explanation is misleading ...?

hanna-kn commented 4 years ago

The description for the nextlunarphase function:

Returns the date when the specified lunar phase occurs. The function searches forward beginning at the specified date. The lunar phase are specified as a number between 0 and 1, where 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons.

This might not be optimal (perhaps using degrees would be better, e.g. 0.5 = 180°). The lunar phase functions were only added because lunar phase calculations were required for calendar conversion and not much thought went into it.