Commit 284282fc authored by Akarsh Simha's avatar Akarsh Simha

Make KSNumbers::obliquity() return CachingDms

Profiling did not reveal a significant advantage here mostly because
of the updateCoords() short-circuit in
StarObject::JITUpdate(). However, I presume that the impact will be
significant when slewing / zooming -- operations that are very hard to
profile, and time steps of > 1 minute, which we will have to
unfortunately address only later.
parent 13ac9e9e
......@@ -22,7 +22,7 @@
#define NUTTERMS 63
#include "dms.h"
#include "cachingdms.h"
/** @class KSNumbers
*
......@@ -55,7 +55,7 @@ public:
/** @return the current Obliquity (the angle of inclination between
*the celestial equator and the ecliptic)
*/
const dms* obliquity() const { return &Obliquity; }
const CachingDms* obliquity() const { return &Obliquity; }
/** @return the constant of aberration (20.49 arcsec). */
dms constAberr() const { return K; }
......@@ -125,7 +125,8 @@ public:
double vEarth(int i) const {return vearth[i];}
private:
dms Obliquity, K, L, L0, LM, M, M0, O, P, D, MM, F;
CachingDms Obliquity;
dms K, L, L0, LM, M, M0, O, P, D, MM, F;
dms XP, YP, ZP, XB, YB, ZB;
double CX, SX, CY, SY, CZ, SZ;
double CXB, SXB, CYB, SYB, CZB, SZB;
......
......@@ -95,11 +95,11 @@ KSPlanetBase* KSPlanetBase::createPlanet( int n ) {
return 0;
}
void KSPlanetBase::EquatorialToEcliptic( const dms *Obliquity ) {
void KSPlanetBase::EquatorialToEcliptic( const CachingDms *Obliquity ) {
findEcliptic( Obliquity, ep.longitude, ep.latitude );
}
void KSPlanetBase::EclipticToEquatorial( const dms *Obliquity ) {
void KSPlanetBase::EclipticToEquatorial( const CachingDms *Obliquity ) {
setFromEcliptic( Obliquity, ep.longitude, ep.latitude );
}
......
......@@ -111,12 +111,12 @@ public:
/** @short Convert Ecliptic logitude/latitude to Right Ascension/Declination.
* @param Obliquity current Obliquity of the Ecliptic (angle from Equator)
*/
void EclipticToEquatorial( const dms *Obliquity );
void EclipticToEquatorial( const CachingDms *Obliquity );
/** @short Convert Right Ascension/Declination to Ecliptic logitude/latitude.
* @param Obliquity current Obliquity of the Ecliptic (angle from Equator)
*/
void EquatorialToEcliptic( const dms *Obliquity );
void EquatorialToEcliptic( const CachingDms *Obliquity );
/** @return pointer to this planet's texture */
const QImage& image() const { return m_image; }
......
......@@ -155,7 +155,7 @@ void SkyPoint::HorizontalToEquatorial( const dms *LST, const dms *lat ) {
RA.setD( RA.reduce().Degrees() ); // 0 <= RA < 24
}
void SkyPoint::findEcliptic( const dms *Obliquity, dms &EcLong, dms &EcLat ) {
void SkyPoint::findEcliptic( const CachingDms *Obliquity, dms &EcLong, dms &EcLat ) {
double sinRA, cosRA, sinOb, cosOb, sinDec, cosDec, tanDec;
ra().SinCos( sinRA, cosRA );
dec().SinCos( sinDec, cosDec );
......@@ -169,7 +169,7 @@ void SkyPoint::findEcliptic( const dms *Obliquity, dms &EcLong, dms &EcLat ) {
EcLat.setRadians( asin( sinDec*cosOb - cosDec*sinOb*sinRA ) );
}
void SkyPoint::setFromEcliptic( const dms *Obliquity, const dms& EcLong, const dms& EcLat ) {
void SkyPoint::setFromEcliptic( const CachingDms *Obliquity, const dms& EcLong, const dms& EcLat ) {
double sinLong, cosLong, sinLat, cosLat, sinObliq, cosObliq;
EcLong.SinCos( sinLong, cosLong );
EcLat.SinCos( sinLat, cosLat );
......
......@@ -232,13 +232,13 @@ public:
*The ecliptic coordinates are returned as reference arguments (since
*they are not stored internally)
*/
void findEcliptic( const dms *Obliquity, dms &EcLong, dms &EcLat );
void findEcliptic( const CachingDms *Obliquity, dms &EcLong, dms &EcLat );
/** Set the current (RA, Dec) coordinates of the
*SkyPoint, given pointers to its Ecliptic (Long, Lat) coordinates, and
*to the current obliquity angle (the angle between the equator and ecliptic).
*/
void setFromEcliptic( const dms *Obliquity, const dms& EcLong, const dms& EcLat );
void setFromEcliptic( const CachingDms *Obliquity, const dms& EcLong, const dms& EcLat );
/** Computes galactic coordinates from equatorial coordinates referred to
* epoch 1950. RA and Dec are, therefore assumed to be B1950
......
Markdown is supported
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