Ignore:
Timestamp:
08/06/12 11:37:40 (12 years ago)
Author:
tbretz
Message:
The month is given in the range 0..11 not 1..12
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/shift/calendar.js

    r13774 r14312  
    841841    this.getMoonPhase = function(Y, M, D)
    842842    {
     843        // M=0..11 --> 1..12
     844        M += 1;
     845
    843846        // calculate the Julian date at 12h UT
    844847        var YY = Y - Math.floor( ( 12 - M ) / 10 );
     
    855858        // calculate moon's age in days
    856859        var IP = ( ( JD - 2451550.1 ) / 29.530588853 ) % 1;
     860
    857861        return IP;
    858862
    859863        // Moon's age
    860864        //var AG = IP*29.53;
    861 
    862865    }
    863866
Note: See TracChangeset for help on using the changeset viewer.