[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Alexey Khudyakov
alexey.skladnoy at gmail.com
Tue Jun 16 20:23:10 CEST 2009
SVN commit 982737 by khudyakov:
Refactor angular distance calculation for opposition takig
advantage of the fact that if distance between A and B is x
distance between B and point opposite A is (180-x)
CCMAIL: kstars-devel at kde.org
M +2 -7 ksconjunct.cpp
--- trunk/KDE/kdeedu/kstars/kstars/tools/ksconjunct.cpp #982736:982737
@@ -138,14 +138,9 @@
}
Object2->findPosition(&num, geoPlace->lat(), &LST, m_Earth);
- if(opposition) {
- Object2->setRA( Object2->ra()->Hours() + 12.0);
- Object2->setDec( -Object2->dec()->Degrees());
- }
dist.setRadians(Object1 -> angularDistanceTo(Object2).radians());
- if(opposition) {
- Object2->setRA( Object2->ra()->Hours() - 12.0);
- Object2->setDec( -Object2->dec()->Degrees());
+ if( opposition ) {
+ dist.set( 180 - dist.Degrees() );
}
return dist;
}
More information about the Kstars-devel
mailing list