Attenzione! Javascript è disabilitato

The Sky Of Baronie

Welcome to this site, dedicated to the beauty of the sky of Sardinia...

Versione inglese
Versione inglese

ASTROJS – Code examples: The Equinoxes and Solstices dates

Listings made to calculate the dates of the Equinoxes and Solstices.
Before commencing, connect your Html page to the Astrojs library, pasting the following listing, under the tag <title>.
IMPORTANT! The functions in red, are not Javascript commands, but belong to the Astrojs library.

<script type="text/javascript" src="http://www.suchelu.it/astrojs/astrojs.js"></script>

You can use the left menu, for enter to macros list...

Calculation of dates in Julian Days, of the Equinoxes and Solstices:

<script language="JavaScript" type="text/javascript">

   //<!--

    var yy=2013;                     // Insert year without decimals.

    var date_eqsol=eqsol(yy);        // (1) calculates the julian day number for the dates.

              // Retrieves the results from the Array: date_eqsol[0,..3] 

    var njd1=date_eqsol[0];          //  March Equinox. 
    var njd2=date_eqsol[1];          //  June Solstice. 
    var njd3=date_eqsol[2];          //  September Equinox.
    var njd4=date_eqsol[3];          //  December Solstice.

                                      // writes the results.

    document.write(njd1+"<br>");      // March Equinox.
    document.write(njd2+"<br>");      // June Solstice.
    document.write(njd3+"<br>");      // September Equinox.
    document.write(njd4+"<br>");      // December Solstice.

   //-->

</script>

The instants are expressed in Julian Days U.T.

Calculation of the calendar dates of the Equinoxes and Solstices:

Listing the same as the previous one, with the transformation of the J.D. in calendar dates with the instants expressed in U.T.

<script language="JavaScript" type="text/javascript">

   //<!--

    var yy=2013;                  // Insert year without decimals.

    var date_eqsol=eqsol(yy);     // (1) calculates the julian day for the dates.

              // Retrieves the results from the Array: date_eqsol[0,..3]

    var njd1=date_eqsol[0];    //  March Equinox. 
    var njd2=date_eqsol[1];    //  June Solstice. 
    var njd3=date_eqsol[2];    //  September Equinox.
    var njd4=date_eqsol[3];    //  December Solstice.

    // Calendar dates.

    var data1=jd_data(njd1);                                      // calendar date1.
    var dataf1=sc_day_hm(data1[0])+" : "+data1[1]+" : "+data1[2]; // formatting of the date.

    var data2=jd_data(njd2);                                      // calendar date2. 
    var dataf2=sc_day_hm(data2[0])+" : "+data2[1]+" : "+data2[2]; // formatting of the date.

    var data3=jd_data(njd3);                                      // calendar date3. 
    var dataf3=sc_day_hm(data3[0])+" : "+data3[1]+" : "+data3[2]; // formatting of the date.

    var data4=jd_data(njd4);                                      // calendar date4.
    var dataf4=sc_day_hm(data4[0])+" : "+data4[1]+" : "+data4[2]; // formatting of the date

                                     // writes the results.

    document.write(dataf1+"<br>");   // March Equinox.
    document.write(dataf2+"<br>");   // June Solstice.
    document.write(dataf3+"<br>");   // September Equinox.
    document.write(dataf4+"<br>");   // December Solstice.

   //-->

</script>

Apri menu: >>

Copyright ©2009 - Salvatore Ruiu
Tutti i contenuti del sito sono protetti dal diritto d'autore.
All Rights Reserved.

Questo sito è Online da dicembre 2009 || Ultima modifica: 10-Dicembre 2009 || Questa pagina web rispetta le direttive del W3C | CSS 2.1 | XHTML 1.0