ICU-2424 fixes for astronomer

X-SVN-Rev: 13847
This commit is contained in:
Steven R. Loomis 2003-11-24 21:34:45 +00:00
parent a084fd2aa3
commit 7c46a9b274
2 changed files with 9 additions and 5 deletions

View file

@ -227,6 +227,10 @@ CalendarAstronomer::CalendarAstronomer(double longitude, double latitude) :
fGmtOffset = (double)(fLongitude * 24 * HOUR_MS / CalendarAstronomer::PI2);
}
CalendarAstronomer::~CalendarAstronomer()
{
delete moonPosition;
}
//-------------------------------------------------------------------------
// Time and date getters and setters
@ -1274,7 +1278,6 @@ UDate CalendarAstronomer::riseOrSet(CoordFunc& func, UBool rise,
rise?"T":"F", diameter, refraction, epsilon));
do {
// See "Practical Astronomy With Your Calculator, section 33.
delete pos;
pos = func.eval(*this);
double angle = ::acos(-tanL * ::tan(pos->declination));
double lst = ((rise ? CalendarAstronomer::PI2-angle : angle) + pos->ascension ) * 24 / CalendarAstronomer::PI2;
@ -1296,7 +1299,6 @@ UDate CalendarAstronomer::riseOrSet(CoordFunc& func, UBool rise,
double y = ::asin(sin(x) / ::sin(psi));
long delta = (long)((240 * y * RAD_DEG / cosD)*SECOND_MS);
delete pos;
return fTime + (rise ? -delta : delta);
}

View file

@ -97,7 +97,7 @@ public:
UnicodeString toString() {
char tmp[800];
sprintf(tmp, "[%.5f,%.5f]", longitude*RAD_DEG, latitude*RAD_DEG);
return UnicodeString(tmp,"");
return UnicodeString(tmp);
}
/**
@ -164,7 +164,7 @@ public:
char tmp[400];
sprintf(tmp, "%lf,%lf",
(ascension*RAD_DEG), (declination*RAD_DEG));
return UnicodeString(tmp, "");
return UnicodeString(tmp);
}
/**
@ -237,7 +237,7 @@ public:
UnicodeString toString() {
char tmp[800];
sprintf(tmp, "[%.5f,%.5f]", altitude*RAD_DEG, azimuth*RAD_DEG);
return UnicodeString(tmp,"");
return UnicodeString(tmp);
}
/**
@ -445,6 +445,8 @@ public:
* @deprecated ICU 2.4. This class may be removed or modified.
*/
CalendarAstronomer(double longitude, double latitude);
~CalendarAstronomer();
//-------------------------------------------------------------------------