Skybright.cpp   Skybright.cpp 
skipping to change at line 19 skipping to change at line 19
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelUtils.hpp"
#include <cmath> #include <cmath>
#include <QDebug> #include <QDebug>
#include "Skybright.hpp" #include "Skybright.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelApp.hpp"
#include "StelModuleMgr.hpp"
#include "SolarSystem.hpp"
Skybright::Skybright() : SN(1.f) Skybright::Skybright() : SN(1.f)
{ {
setDate(2003, 8, 0); setDate(2003, 8, 0);
setLocation(M_PI_4, 1000., 25.f, 40.f); setLocation(M_PI_4, 1000., 25.f, 40.f);
setSunMoon(0.5, 0.5); setSunMoon(0.5, 0.5);
} }
// month : 1=Jan, 12=Dec // month : 1=Jan, 12=Dec
// moonPhase in radian 0=Full Moon, PI/2=First Quadrant/Last Quadran, PI=No Moon // moonPhase in radian 0=Full Moon, PI/2=First Quadrant/Last Quadran, PI=No Moon
skipping to change at line 95 skipping to change at line 96
} }
// Compute the luminance at the given position // Compute the luminance at the given position
// Inputs : cosDistMoon = cos(angular distance between moon and the positio n) // Inputs : cosDistMoon = cos(angular distance between moon and the positio n)
// cosDistSun = cos(angular distance between sun and the position) // cosDistSun = cos(angular distance between sun and the position)
// cosDistZenith = cos(angular distance between zenith and the position) // cosDistZenith = cos(angular distance between zenith and the position)
float Skybright::getLuminance( float cosDistMoon, float Skybright::getLuminance( float cosDistMoon,
const float cosDistSun, const float cosDistSun,
const float cosDistZenith) const const float cosDistZenith) const
{ {
// No Sun and Moon on the sky
// Details: https://bugs.launchpad.net/stellarium/+bug/1499699
if (!GETSTELMODULE(SolarSystem)->getFlagPlanets())
return 0.f;
// Air mass // Air mass
const float bKX = stelpow10f(-0.4f * K * (1.f / (cosDistZenith + 0.0 25f*StelUtils::fastExp(-11.f*cosDistZenith)))); const float bKX = stelpow10f(-0.4f * K * (1.f / (cosDistZenith + 0.0 25f*StelUtils::fastExp(-11.f*cosDistZenith))));
// Daylight brightness // Daylight brightness
const float distSun = StelUtils::fastAcos(cosDistSun); const float distSun = StelUtils::fastAcos(cosDistSun);
const float FSv = 18886.28f / (distSun*distSun + 0.0007f) const float FSv = 18886.28f / (distSun*distSun + 0.0007f)
+ stelpow10f(6.15f - (distSun+0.001f)* 1.43239f) + stelpow10f(6.15f - (distSun+0.001f)* 1.43239f)
+ 229086.77f * ( 1.06f + cosDistSun*cosDistSun ); + 229086.77f * ( 1.06f + cosDistSun*cosDistSun );
const float b_daylight = 9.289663e-12f * (1.f - bKX) * (FSv * C4 + 4 40000.f * (1.f - C4)); const float b_daylight = 9.289663e-12f * (1.f - bKX) * (FSv * C4 + 4 40000.f * (1.f - C4));
 End of changes. 3 change blocks. 
2 lines changed or deleted 8 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/