Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moon Illumination phaseValue is not continuous #7

Open
jazztunes opened this issue Dec 1, 2023 · 2 comments
Open

Moon Illumination phaseValue is not continuous #7

jazztunes opened this issue Dec 1, 2023 · 2 comments

Comments

@jazztunes
Copy link

Problem

It appears that getMoonIllumination.phaseValue is not continuous.

As a test, I wrote a short program that prints out the phaseValue for each minute. Here you can see the phase value takes a big jump between 20:05 and 20:06. I would expect it to be a smooth transition from one minute to the next.

In terms of age, this about 3/4 of a day!

I hope I'm missing something.

--DH

Moon Phase Test Results

2023-01-06T20:01:00.000Z :: 0.4871753060126663
2023-01-06T20:02:00.000Z :: 0.4871768596219541
2023-01-06T20:03:00.000Z :: 0.4871783801686171
2023-01-06T20:04:00.000Z :: 0.4871798676416214
2023-01-06T20:05:00.000Z :: 0.4871813220302154
2023-01-06T20:06:00.000Z :: 0.5128172566761461
2023-01-06T20:07:00.000Z :: 0.5128158684877107
2023-01-06T20:08:00.000Z :: 0.5128145134145109
2023-01-06T20:09:00.000Z :: 0.5128131914662997
2023-01-06T20:10:00.000Z :: 0.5128119026517515

Steps to Reproduce

You can see my test program at: https://jsfiddle.net/jazztunes/6kaz81o7/

@petrospap
Copy link

petrospap commented Jan 26, 2024

Seems like phaseValue > angle changes from negative to +

const phaseValue = 0.5 + 0.5 * inc * (angle < 0 ? -1 : 1) / Math.PI;`

Needs different calculation?

@petrospap
Copy link

my test shows

2023-01-06T20:01:00.000Z :: 0.4871753060126663 : inc= 0.08057992883028949 : angle= -0.006864309966472515 phi 3.060794777247738

2023-01-06T20:02:00.000Z :: 0.4871768596219541 : inc= 0.0805701672152393 : angle= -0.0051863596624214855 phi 3.060804564707265

2023-01-06T20:03:00.000Z :: 0.48717838016861714 : inc= 0.08056061333878714 : angle= -0.0035080388833727575 phi 3.0608141438679413

2023-01-06T20:04:00.000Z :: 0.48717986764162136 : inc= 0.08055126727026235 : angle= -0.0018293557850178684 phi 3.060823514660245

2023-01-06T20:05:00.000Z :: 0.4871813220302154 : inc= 0.08054212907721703 : angle= -0.00015031851512667426 phi 3.060832677016437

2023-01-06T20:06:00.000Z :: 0.5128172566761461 : inc= 0.08053319882591041 : angle= 0.0015290647419691848 phi 3.060841630870074

2023-01-06T20:07:00.000Z :: 0.5128158684877107 : inc= 0.08052447658072927 : angle= 0.0032087858174714625 phi 3.0608503761565897

2023-01-06T20:08:00.000Z :: 0.5128145134145109 : inc= 0.08051596240471047 : angle= 0.004888836510851489 phi 3.0608589128127726

2023-01-06T20:09:00.000Z :: 0.5128131914662997 : inc= 0.080507656359133 : angle= 0.006569208629383839 phi 3.060867240777173

2023-01-06T20:10:00.000Z :: 0.5128119026517515 : inc= 0.08049955849849981 : angle= 0.008249895078669037 phi 3.0608753599951353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants