~ubuntu-branches/ubuntu/lucid/wmmoonclock/lucid

« back to all changes in this revision

Viewing changes to Src/MoonRise.c

  • Committer: Bazaar Package Importer
  • Author(s): Denis Briand
  • Date: 2009-07-26 10:30:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090726103000-2y5ws6okikxakvfp
Tags: 1.27-28
* Add southern hemisphere support (Closes: #537480).
  Thanks to Alvaro Steiger.
* Bump standards version to 3.8.2.0
* Add quilt patch system.
* Add patches:
  + 01_all_previous_diff.diff
  + 02_update_time.diff
  + 03_add_southern_hemisphere_support.diff
  + 04_fix_hyphen_used_as_minus_sign.diff
* Add debhelper 7 build depends.
* Add debian/compat file.
* Remove trailing whitespaces in changelog.upstream.
* Add an empty watch file (no upstream repository).
* Improve rules file by using more debhelper commands.
* Remove Martin A. Godisch from uploaders field
  Thanks to him to have sponsored wmmoonclock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
2
2
#include <math.h>
3
 
#include "MoonRise.h"
4
 
#include "Moon.h"
5
3
 
6
4
#define DegPerRad       57.29577951308232087680
7
5
#define RadPerDeg        0.01745329251994329576
9
7
extern  double  Glon, SinGlat, CosGlat, TimeZone;
10
8
 
11
9
 
12
 
void MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
 
10
MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
13
11
 
14
12
    double      UT, ym, y0, yp, SinH0;
15
13
    double      xe, ye, z1, z2, SinH(), hour24();
78
76
}
79
77
 
80
78
 
81
 
void UTTohhmm(double UT, int *h, int *m){
 
79
UTTohhmm(double UT, int *h, int *m){
82
80
 
83
81
 
84
82
    if (UT < 0.0) {
87
85
    } else {
88
86
        *h = (int)UT;
89
87
        *m = (int)((UT-(double)(*h))*60.0+0.5);
90
 
        if (*m == 60) {
91
 
            /* 
92
 
             *  If it was 23:60 this should become 24:00
93
 
             *  I prefer this designation to 00:00. So dont reset h to 0 when it goes above 24.
94
 
             */
95
 
            *h += 1;
96
 
            *m = 0;
97
 
        }
98
88
    }
99
89
 
100
90
}
104
94
 
105
95
 
106
96
 
107
 
void Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
 
97
Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
108
98
 
109
99
    double      a, b, c, d, dx;
110
100
 
125
115
        if (*z1 < -1.0) *z1 = *z2;
126
116
    }
127
117
 
 
118
    return(0);
128
119
 
129
120
 
130
121
}
134
125
 
135
126
double SinH(int year, int month, int day, double UT){
136
127
 
137
 
    double      TU, frac(), jd();
138
 
    double      RA_Moon, DEC_Moon, gmst, lmst, Tau, Moon();
 
128
    double      TU, TU2, TU3, LambdaMoon, BetaMoon, R, AGE, frac(), jd();
 
129
    double      RA_Moon, DEC_Moon, T0, gmst, lmst, Tau, epsilon, Moon();
139
130
    double      angle2pi();
140
131
 
141
132
    TU = (jd(year, month, day, UT) - 2451545.0)/36525.0;