Example #1
0
void KSPlanetBase::findPosition( const KSNumbers *num, const dms *lat, const dms *LST, const KSPlanetBase *Earth ) {
    // DEBUG edit
    findGeocentricPosition( num, Earth );  //private function, reimplemented in each subclass
    findPhase();
    setAngularSize( asin(physicalSize()/Rearth/AU_KM)*60.*180./dms::PI ); //angular size in arcmin

    if ( lat && LST )
        localizeCoords( num, lat, LST ); //correct for figure-of-the-Earth

    if ( hasTrail() ) {
        addToTrail( KStarsDateTime( num->getJD() ).toString( "yyyy.MM.dd hh:mm" ) + i18nc("Universal time", "UT") ); // TODO: Localize date/time format?
        if ( Trail.size() > TrailObject::MaxTrail )
            clipTrail();
    }

    findMagnitude(num);

    if ( type() == SkyObject::COMET ) {
        // Compute tail size
        KSComet *me = (KSComet *)this;
        double TailAngSize;
        // Convert the tail size in km to angular tail size (degrees)
        TailAngSize = asin(physicalSize()/Rearth/AU_KM)*60.0*180.0/dms::PI;
        // Find the apparent length as projected on the celestial sphere (the comet's tail points away from the sun)
        me->setTailAngSize( TailAngSize * fabs(sin( phase().radians() )));
    }

}
Example #2
0
void KSPlanetBase::updateCoords( KSNumbers *num, bool includePlanets, const dms *lat, const dms *LST ){
	if ( includePlanets ) {
		data->earth()->findPosition( num ); //since we don't pass lat & LST, localizeCoords will be skipped

		if ( lat && LST ) {
			findPosition( num, lat, LST, data->earth() );
			if ( hasTrail() ) Trail.removeLast();
		} else {
			findGeocentricPosition( num, data->earth() );
		}
	}
}
Example #3
0
void KSPlanetBase::findPosition( const KSNumbers *num, const dms *lat, const dms *LST, const KSPlanetBase *Earth ) {
	findGeocentricPosition( num, Earth );  //private function, reimplemented in each subclass

	if ( Earth ) setRearth( Earth );

	if ( lat && LST )
		localizeCoords( num, lat, LST ); //correct for figure-of-the-Earth

	if ( hasTrail() ) {
		Trail.append( new SkyPoint( ra(), dec() ) );
		if ( Trail.count() > MAXTRAIL ) Trail.removeFirst();
	}

	if ( isMajorPlanet() )
		findMagnitude(num);
}
Example #4
0
void KSPlanetBase::updateCoords( const KSNumbers *num, bool includePlanets, const dms *lat, const dms *LST, bool )
{
    KStarsData *kd = KStarsData::Instance();
    if ( includePlanets ) {
        kd->skyComposite()->earth()->findPosition( num ); //since we don't pass lat & LST, localizeCoords will be skipped

        if ( lat && LST ) {
            findPosition( num, lat, LST, kd->skyComposite()->earth() );
            //Don't add to the trail this time
            if( hasTrail() )
                Trail.takeLast();
        } else {
            findGeocentricPosition( num, kd->skyComposite()->earth() );
        }
    }
}