[Kstars-devel] branches/work/kdeedu_kstars_htm/kstars/kstars

James Bowlin bowlin at mindspring.com
Tue Aug 7 05:53:13 CEST 2007


SVN commit 697189 by jbowlin:

I've made a correction to how we calculate proper motion in the htm
branch.  I do the proper motion correction _before_ the precession
correction.  We were doing it the other way around before.  The
problem with the old method is that the direction of the proper motion
correction would change depending on how far we had precessed. 

The new method and the old method give different results.  If someone
can verify the new version is better than the old then I can port it
to the trunk.

We are still using the approximation that the proper motion is small
and is not near one of the poles but at least we are no longer
assuming that the change in coordinates due to precession is small.

CCMAIL: kstars-devel at kde.org


 M  +13 -4     starobject.cpp  


--- branches/work/kdeedu_kstars_htm/kstars/kstars/starobject.cpp #697188:697189
@@ -108,14 +108,23 @@
 }
 
 void StarObject::updateCoords( KSNumbers *num, bool , const dms*, const dms* ) {
-	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. );
+
+    // Correction:  The method below computes the proper motion before the
+    // precession.  If we precessed first then the direction of the proper
+    // motion correction would depend on how far we've precessed.  -jbb 
+    double saveRA = ra0()->Hours();
+    double saveDec = dec0()->Degrees();
+
+	setRA0( ra0()->Hours() + pmRA()*num->julianMillenia() / (15. * cos( dec0()->radians() ) * 3600.) );
+	setDec0( dec0()->Degrees() + pmDec()*num->julianMillenia() / 3600. );
+
+	SkyPoint::updateCoords( num );
+    setRA0( saveRA );
+    setDec0( saveDec );
 }
 
 void StarObject::getIndexCoords( KSNumbers *num, double *ra, double *dec )


More information about the Kstars-devel mailing list