11#include " MoonPhase.h"
22#include < inttypes.h>
33
4- MoonPhase::moonData MoonPhase::getInfo ( const int32_t year, const int32_t month, const int32_t day, const double hour )
4+ MoonPhase::moonData MoonPhase::getInfo ( const int32_t & year, const int32_t & month, const int32_t & day, const double & hour )
55{
6- /*
7- Calculates the phase of the moon at the given epoch.
8- returns the moon percentage that is lit as a real number (0-1)
9- */
6+ /*
7+ Calculates the phase of the moon at the given epoch.
8+ returns the moon percentage that is lit as a real number (0-1)
9+ */
1010 moonData returnValue;
1111 double j = _Julian (year, month, (double )day + hour / 24.0 ) - 2444238.5 ;
1212 double ls = _sun_position (j);
@@ -18,7 +18,7 @@ MoonPhase::moonData MoonPhase::getInfo( const int32_t year, const int32_t month,
1818 return returnValue;
1919}
2020
21- double MoonPhase::_Julian ( int32_t year, int32_t month, double day )
21+ double MoonPhase::_Julian ( int32_t year, int32_t month, const double & day )
2222{
2323 int32_t b, c, e;
2424 b = 0 ;
@@ -37,7 +37,7 @@ double MoonPhase::_Julian( int32_t year, int32_t month, double day )
3737 return b + c + e + day + 1720994.5 ;
3838}
3939
40- double MoonPhase::_sun_position ( const double j )
40+ double MoonPhase::_sun_position ( const double & j )
4141{
4242 double n, x, e, l, dl, v;
4343 int32_t i;
@@ -59,7 +59,7 @@ double MoonPhase::_sun_position( const double j )
5959 return l;
6060}
6161
62- double MoonPhase::_moon_position ( double j, double ls )
62+ double MoonPhase::_moon_position ( const double & j, const double & ls )
6363{
6464 double ms, l, mm, ev, sms, ae, ec;
6565 int32_t i;
0 commit comments