/*
This source file is part of Scol
For the latest info, see http://www.scolring.org

Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt

For others informations, please contact us from http://www.scolring.org/
*/

#ifndef __DATE_SCOL_H__
#define __DATE_SCOL_H__

#include <time.h>


#include "../main_science.h"

#define SCIENCE_DATE_PKG_NB     3



/* Sunrise and sunset */
/* $ IRI : This code comes from the application "Ephemeride". http://www.irizone.net
I developped it under GNU GPL v3 license but i authorize its use in Scol only. */

struct Sun_Sortie
{
    char lever[6];
    char coucher[6];
};

struct Sun_Soleil
{
    double moyanomalie;    /* anomalie moyenne du Soleil */
    double moylongitude;    /* longitude moyenne du Soleil */
    double vraielongitude;  /* longitude vraie */
    double rectX;   /* coordonnées rectangulaire X */
    double rectY;   /* coordonnées rectangulaire Y */
    double rectZ;   /* coordonnées rectangulaire Z */
    double eqtemps; /* équation du temps */
    double declinaison; /* déclinaison */
    double anghoraire;  /* angle horaire au lever et au coucher */
    int solnon;
};

struct Sun_Entree
{
    double longitude;
    double latitude;
    double mois;
    double jour;
    int annee;
    double uheure; /* en TU */
    double fjour;  /* jours écoulés depuis 1er mars */
    struct Sun_Soleil soleil;
    struct Sun_Sortie sortie;
};


const double Sun_E_hr = M_PI / 12.0;
const double Sun_E_ht = (-40.0 / 60.0) * (M_PI / 180.0);
const double Sun_E_k = 0.0172024;
const double Sun_E_jm = 308.67;
const double Sun_E_jl = 21.55;
const double Sun_E_e = 0.0167;
const double Sun_E_ob = 0.4091;

/* Moon rise and set */

#endif  /* __DATE_SCOL_H__ */




