~ubuntu-branches/debian/squeeze/stellarium/squeeze

« back to all changes in this revision

Viewing changes to src/skybright.h

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2008-05-19 21:28:23 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519212823-m5nfiuntxstxzxj7
Tags: 0.9.1-4
Add libxcursor-dev, libxfixes-dev, libxinerama-dev, libqt4-opengl-dev to
build-deps (Closes: #479906)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 /*
2
 
 * Copyright (C) 2003 Fabien Chereau
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
 
 */
18
 
 
19
 
#ifndef _SKYBRIGHT_H_
20
 
#define _SKYBRIGHT_H_
21
 
 
22
 
class Skybright
23
 
{
24
 
public:
25
 
    Skybright();
26
 
 
27
 
        // month : 1=Jan, 12=Dec
28
 
        // moon_phase in radian 0=Full Moon, PI/2=First Quadrant/Last Quadran, PI=No Moon
29
 
        void set_date(int year, int month, float moon_phase);
30
 
 
31
 
        // Set the position parameters
32
 
        // Latitude in radian, altitude in m, temperature in deg. C, humidity in %
33
 
        void set_loc(float latitude, float altitude, float temperature = 15.f,
34
 
                float relative_humidity = 40.f);
35
 
 
36
 
        // Set the moon and sun zenith angular distance (cosin given) and precompute what can be
37
 
        // This funtion has to be called once before any call to get_luminance()
38
 
        // Input : cos_dist_moon_zenith = cos(angular distance between moon and zenith)
39
 
        //                 cos_dist_sun_zenith  = cos(angular distance between sun and zenith)
40
 
        void set_sun_moon(float cos_dist_moon_zenith, float cos_dist_sun_zenith);
41
 
 
42
 
        // Compute the luminance at the given position
43
 
        // Inputs : cos_dist_moon = cos(angular distance between moon and the position)
44
 
        //                      cos_dist_sun  = cos(angular distance between sun  and the position)
45
 
        //                      cos_dist_zenith = cos(angular distance between zenith and the position)
46
 
        float get_luminance(float cos_dist_moon, float cos_dist_sun, float cos_dist_zenith);
47
 
 
48
 
private:
49
 
        float air_mass_moon;    // Air mass for the Moon
50
 
        float air_mass_sun;             // Air mass for the Sun
51
 
 
52
 
        double b_total;                 // Total brightness
53
 
        float b_night;                  // Dark night brightness
54
 
        float b_twilight;               // Twilight brightness
55
 
        float b_daylight;               // Daylight sky brightness
56
 
        float b_moon;                   // Moon brightness
57
 
        float mag_moon;                 // Moon magnitude
58
 
 
59
 
        float RA;                               // Something related with date
60
 
 
61
 
        float K;                                // Useful coef...
62
 
 
63
 
        float C3;                               // Term for moon brightness computation
64
 
        float C4;                               // Term for sky brightness computation
65
 
 
66
 
        float SN;                               // Snellen Ratio (20/20=1.0, good 20/10=2.0)
67
 
 
68
 
        // Optimisation variables
69
 
        float b_night_term;
70
 
        float b_moon_term1;
71
 
        float b_twilight_term;
72
 
 
73
 
};
74
 
 
75
 
#endif // _SKYBRIGHT_H_