[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Jan 30 05:33:55 CET 2004


CVS commit by harris: 

Implemented proper motion of stars.  That was easy, should have done it 
a long time ago! :)

I added StarObject::updateCoords(), which overrides the base version in 
SkyPoint.  

You can check it out by centering on a high PM star like Sirius or 
Procyon, and either setting the date to something like year 7000 or 
setting the timestep to 50 yrs or so.

Note that constellation lines are not tied to the stars; this is going 
to change soon :).  

CCMAIL: kstars-devel at kde.org


  M +17 -0     starobject.cpp   1.18
  M +10 -0     starobject.h   1.16


--- kdeedu/kstars/kstars/starobject.cpp  #1.17:1.18
@@ -75,4 +75,21 @@ StarObject::StarObject( double r, double
 }
 
+void StarObject::updateCoords( KSNumbers *num, bool includePlanets, const dms *lat, const dms *LST ) {
+        SkyPoint::updateCoords( num );
+        
+        //Correct for proper motion of stars.  Determine RA and Dec offsets.
+        //Proper motion is given im milliarcsec per year by the pmRA() and pmDec() functions.
+        //That is numerically identical to the number of arcsec per millenium, so multiply by 
+        //KSNumbers::julianMillenia() to find the offsets in arcsec.
+        setRA( ra()->Hours() + pmRA()*num->julianMillenia() / 15. / cos( dec()->radians() )/3600. );
+        setDec( dec()->Degrees() + pmDec()*num->julianMillenia()/3600. );
+        
+/*      //DEBUG
+        if ( name() == "Sirius" ) {
+                kdDebug() << "Sirius dRA: " << pmRA()*num->julianMillenia()/3600. 
+                                                        << "   dDec: " << pmDec()*num->julianMillenia()/3600. << endl;
+        }*/
+}
+
 QString StarObject::sptype( void ) const {
         return SpType;

--- kdeedu/kstars/kstars/starobject.h  #1.15:1.16
@@ -117,4 +117,14 @@ class StarObject : public SkyObject {
         QString constell( void ) const;
 
+/**Determine the current coordinates (RA, Dec) from the catalog
+        *coordinates (RA0, Dec0), accounting for both precession and nutation.
+        *@param num pointer to KSNumbers object containing current values of
+        *time-dependent variables.
+        *@param includePlanets does nothing in this implementation (see KSPlanetBase::updateCoords()).
+        *@param lat does nothing in this implementation (see KSPlanetBase::updateCoords()).
+        *@param LST does nothing in this implementation (see KSPlanetBase::updateCoords()).
+        */
+        virtual void updateCoords( KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0 );
+
 /**@short Set the Ra and Dec components of the star's proper motion, in milliarcsec/year.
         *Note that the RA component is multiplied by cos(dec).




More information about the Kstars-devel mailing list