[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Tue Jan 25 06:25:02 CET 2005


CVS commit by harris: 

Fixing positions of the planets in image-dump mode.  There was a bug 
that made the first calculated position of the planets incorrect, though 
all subsequent calculations were correct.  In image-dump mode, positions 
are only calculated once, so you got the wrong positions.

The bug was in the correction for "figure of the Earth" (i.e., our point 
of view is from a point on the surface of the Earth, not at its center).  
As the code was written, it attempted to apply the figure-of-the-Earth 
correction *before* the planet's distance from the Earth was calculated.  
The correction needs the Earth distance, so it returned a garbage 
answer.  The problem only manifested the first time, because on 
subsequent calls, the earth distance had by then been defined. 

Now, the distance from Earth is computed before the correction is made.

Thanks for the bug reports.  If you have the KStars source code, you can 
easily patch your local copy.  Edit the file ksplanetbase.cpp, and find 
the "findPosition" function.  Move the line containing "setRearth" to 
just after the "findGeocentricPosition" line.

CCMAIL: kstars-devel at kde.org
BUG: 77564


  M +2 -2      ksplanetbase.cpp   1.22
  M +0 -1      planetcatalog.cpp   1.17


--- kdeedu/kstars/kstars/ksplanetbase.cpp  #1.21:1.22
@@ -73,9 +73,9 @@ void KSPlanetBase::findPosition( const K
         findGeocentricPosition( num, Earth );  //private function, reimplemented in each subclass
 
+        if ( Earth ) setRearth( Earth );
+
         if ( lat && LST )
                 localizeCoords( num, lat, LST ); //correct for figure-of-the-Earth
 
-        if ( Earth ) setRearth( Earth );
-
         if ( hasTrail() ) {
                 Trail.append( new SkyPoint( ra(), dec() ) );




More information about the Kstars-devel mailing list