aaghevli / orbit

4 stars 1 forks source link

toDateNumber incorrect #4

Open unity-github opened 3 years ago

unity-github commented 3 years ago

I've been comparing moon positions with the Horizons calculator and is shows the 'toDateNumber' calculation is incorrect by 1 or 2 depending on rounding.

The correct code should just be: function toDateNumber(date) { var diff = (date - new Date("2000-01-01T00:00")); return (1 + diff.valueOf()/86400e3); }

aaghevli commented 3 years ago

Hey thanks! I may be able to look and fix this. I appreciate the review.