Commit e01f22a4 authored by Akarsh Simha's avatar Akarsh Simha
Browse files

Some minor optimizations.

parent 786e4fcc
......@@ -219,9 +219,9 @@ void SkyPoint::precess( const KSNumbers *num ) {
}
//Extract RA, Dec from the vector:
RA.setRadians( atan2( v[1], v[0] ) );
RA.setUsing_atan2( v[1], v[0] );
RA.reduce();
Dec.setRadians( asin( v[2] ) );
Dec.setUsing_asin( v[2] );
}
SkyPoint SkyPoint::deprecess( const KSNumbers *num, long double epoch ) {
......@@ -411,12 +411,12 @@ void SkyPoint::precessFromAnyEpoch(long double jd0, long double jdf){
RA.setD( RA0.Degrees() );
Dec.setD( Dec0.Degrees() );
RA.SinCos( sinRA, cosRA );
Dec.SinCos( sinDec, cosDec );
if (jd0 == jdf)
return;
RA.SinCos( sinRA, cosRA );
Dec.SinCos( sinDec, cosDec );
if ( jd0 == B1950) {
B1950ToJ2000();
jd0 = J2000;
......
......@@ -272,6 +272,10 @@ void StarObject::updateCoords( const KSNumbers *num, bool , const CachingDms*, c
// FIXME: Find a better way to do this without conditionals etc.
// Having the conditional is good so we can use CachingDms on RA0 and Dec0
// FIXME: This code is very inefficient as it destroys the
// sine/cosine cache and repeatedly recreates it!
if ( properMotionCorrections ) {
newRA /= 15.0; // getIndexCoords returns in Degrees, while we want the RA in Hours
setRA0( newRA );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment