[Kstars-devel] KDE_3_2_BRANCH: kdeedu/kstars/kstars

Pablo de Vicente p.devicente at wanadoo.es
Thu Apr 22 12:18:39 CEST 2004


CVS commit by pvicente: 

These changes are necessary to fix a bug in the Solar system viewer which shows in wrong
position the planets, mainly the inner ones, since they are depicted according to their
ecliptic geocentric coordinates and not according to their heliocentric ones.

Function findGeocentricPosition() stores now the heliocentric ecliptic coordinates taking
profit of the new defined private member in KSPlanetBase

FIX in the BRANCH

CCMAIL: kstars-devel at kde.org


  M +11 -0     ksplanet.cpp   1.20.2.1


--- kdeedu/kstars/kstars/ksplanet.cpp  #1.20:1.20.2.1
@@ -242,6 +242,16 @@ bool KSPlanet::findGeocentricPosition( c
                 double eZ = Earth->rsun()*sinB0;
 
+                bool once = true;
+                
                 while (fabs(dst - olddst) > .001) {
                         calcEcliptic(jm, trialpos);
+                
+                        // We store the heliocentric ecliptic coordinates the first time 
+                        // they are computed.
+                        if(once){
+                                   helEcPos = trialpos;
+                                   once=false;
+                        }
+                        
                         olddst = dst;
 
@@ -276,4 +286,5 @@ bool KSPlanet::findGeocentricPosition( c
 
                 calcEcliptic(num->julianMillenia(), ep);
+                helEcPos = ep;
         }
 




More information about the Kstars-devel mailing list