本文整理汇总了C++中SkyPoint::HorizontalToEquatorial方法的典型用法代码示例。如果您正苦于以下问题:C++ SkyPoint::HorizontalToEquatorial方法的具体用法?C++ SkyPoint::HorizontalToEquatorial怎么用?C++ SkyPoint::HorizontalToEquatorial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkyPoint
的用法示例。
在下文中一共展示了SkyPoint::HorizontalToEquatorial方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotComputeCoords
void modCalcAzel::slotComputeCoords()
{
SkyPoint sp;
double epoch0 = getEpoch( epochName->text() );
KStarsDateTime dt;
dt.setFromEpoch( epoch0 );
long double jd = getDateTime().djd();
long double jd0 = dt.djd();
dms LST( getDateTime().gst().Degrees() + getLongitude().Degrees() );
if(radioApCoords->isChecked()) {
sp = getEquCoords();
sp.apparentCoord(jd0, jd);
dms lat(getLatitude());
sp.EquatorialToHorizontal( &LST, &lat );
showHorCoords( sp );
} else {
sp = getHorCoords();
dms lat(getLatitude());
sp.HorizontalToEquatorial( &LST, &lat );
showEquCoords( sp );
}
}
示例2: fromScreen
SkyPoint EquirectangularProjector::fromScreen(const QPointF& p, dms* LST, const dms* lat) const
{
SkyPoint result;
//Convert pixel position to x and y offsets in radians
double dx = (0.5*m_vp.width - p.x())/m_vp.zoomFactor;
double dy = (0.5*m_vp.height - p.y())/m_vp.zoomFactor;
if ( m_vp.useAltAz ) {
dms az, alt;
dx = -1.0*dx; //Azimuth goes in opposite direction compared to RA
az.setRadians( dx + m_vp.focus->az().radians() );
alt.setRadians( dy + m_vp.focus->alt().radians() );
result.setAz( az.reduce() );
if ( m_vp.useRefraction )
alt = SkyPoint::unrefract( alt );
result.setAlt( alt );
result.HorizontalToEquatorial( LST, lat );
return result;
} else {
dms ra, dec;
ra.setRadians( dx + m_vp.focus->ra().radians() );
dec.setRadians( dy + m_vp.focus->dec().radians() );
result.set( ra.reduce(), dec );
result.EquatorialToHorizontal( LST, lat );
return result;
}
}
示例3: slotCompute
void modCalcAltAz::slotCompute()
{
//Determine whether we are calculating Alt/Az coordinates from RA/Dec,
//or vice versa. We calculate Alt/Az by default, unless the signal
//was sent by changing the Az or Alt value.
if ( sender()->objectName() == "Az" || sender()->objectName() == "Alt" ) {
//Validate Az and Alt coordinates
bool ok( false );
dms alt;
dms az = Az->createDms( true, &ok );
if ( ok ) alt = Alt->createDms( true, &ok );
if ( ok ) {
SkyPoint sp;
sp.setAz( az );
sp.setAlt( alt );
sp.HorizontalToEquatorial( &LST, geoPlace->lat() );
RA->showInHours( sp.ra() );
Dec->showInDegrees( sp.dec() );
}
} else {
//Validate RA and Dec coordinates
bool ok( false );
dms ra;
dms dec = Dec->createDms( true, &ok );
if ( ok ) ra = RA->createDms( false, &ok );
if ( ok ) {
SkyPoint sp( ra, dec );
sp.EquatorialToHorizontal( &LST, geoPlace->lat() );
Az->showInDegrees( sp.az() );
Alt->showInDegrees( sp.alt() );
}
}
}
示例4: pointAt
SkyPoint Projector::pointAt(double az, KStarsData* data)
{
SkyPoint p;
p.setAz( az );
p.setAlt( 0.0 );
p.HorizontalToEquatorial( data->lst(), data->geo()->lat() );
return p;
}
示例5: fromScreen
SkyPoint Projector::fromScreen(const QPointF& p, dms* LST, const dms* lat) const
{
dms c;
double sinc, cosc;
/** N.B. We don't cache these sin/cos values in the inverse
* projection because it causes 'shaking' when moving the sky.
*/
double sinY0, cosY0;
//Convert pixel position to x and y offsets in radians
double dx = (0.5*m_vp.width - p.x())/m_vp.zoomFactor;
double dy = (0.5*m_vp.height - p.y())/m_vp.zoomFactor;
double r = sqrt( dx*dx + dy*dy );
c.setRadians( projectionL(r) );
c.SinCos( sinc, cosc );
if( m_vp.useAltAz ) {
dx = -1.0*dx; //Azimuth goes in opposite direction compared to RA
m_vp.focus->alt().SinCos( sinY0, cosY0 );
} else {
m_vp.focus->dec().SinCos( sinY0, cosY0 );
}
double Y = asin( cosc*sinY0 + ( dy*sinc*cosY0 )/r );
double atop = dx*sinc;
double abot = r*cosY0*cosc - dy*sinY0*sinc;
double A = atan2( atop, abot );
SkyPoint result;
if ( m_vp.useAltAz ) {
dms alt, az;
alt.setRadians( Y );
az.setRadians( A + m_vp.focus->az().radians() );
if ( m_vp.useRefraction )
alt = SkyPoint::unrefract( alt );
result.setAlt( alt );
result.setAz( az );
result.HorizontalToEquatorial( LST, lat );
} else {
dms ra, dec;
dec.setRadians( Y );
ra.setRadians( A + m_vp.focus->ra().radians() );
result.set( ra.reduce(), dec );
result.EquatorialToHorizontal( LST, lat );
}
return result;
}
示例6: PointListComponent
HorizonComponent::HorizonComponent(SkyComposite *parent )
: PointListComponent( parent )
{
KStarsData *data = KStarsData::Instance();
emitProgressText( i18n("Creating horizon" ) );
//Define Horizon
for ( unsigned int i=0; i<NCIRCLE; ++i ) {
SkyPoint *o = new SkyPoint();
o->setAz( i*360./NCIRCLE );
o->setAlt( 0.0 );
o->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
pointList().append( o );
}
}
示例7: processLines
//.........这里部分代码省略.........
if (latCheckBatch->isChecked() )
ostream << latB.toDMSString() << space;
// Read Epoch and write in ostream if corresponds
if(epochCheckBatch->isChecked() ) {
epoch0B = fields[i].toDouble();
i++;
} else
epoch0B = getEpoch( epochBoxBatch->text() );
if ( allRadioBatch->isChecked() )
ostream << epoch0B << space;
else
if(epochCheckBatch->isChecked() )
ostream << epoch0B << space;
// We make the first calculations
KStarsDateTime dt;
dt.setFromEpoch( epoch0B );
jdf = KStarsDateTime(dtB,utB).djd();
jd0 = dt.djd();
LST = KStarsDateTime(dtB,utB).gst().Degrees() + longB.Degrees();
// Equatorial coordinates are the input coords.
if (!horInputCoords) {
// Read RA and write in ostream if corresponds
if(raCheckBatch->isChecked() ) {
raB = dms::fromString( fields[i],FALSE);
i++;
} else
raB = raBoxBatch->createDms(FALSE);
if ( allRadioBatch->isChecked() )
ostream << raB.toHMSString() << space;
else
if(raCheckBatch->isChecked() )
ostream << raB.toHMSString() << space;
// Read DEC and write in ostream if corresponds
if(decCheckBatch->isChecked() ) {
decB = dms::fromString( fields[i], TRUE);
i++;
} else
decB = decBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << decB.toDMSString() << space;
else
if(decCheckBatch->isChecked() )
ostream << decB.toDMSString() << space;
sp = SkyPoint (raB, decB);
sp.apparentCoord(jd0, jdf);
sp.EquatorialToHorizontal( &LST, &latB );
ostream << sp.az()->toDMSString() << space << sp.alt()->toDMSString() << endl;
// Input coords are horizontal coordinates
} else {
if(azCheckBatch->isChecked() ) {
azB = dms::fromString( fields[i],FALSE);
i++;
} else
azB = azBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << azB.toHMSString() << space;
else
if(raCheckBatch->isChecked() )
ostream << azB.toHMSString() << space;
// Read DEC and write in ostream if corresponds
if(elCheckBatch->isChecked() ) {
elB = dms::fromString( fields[i], TRUE);
i++;
} else
elB = decBoxBatch->createDms();
if ( allRadioBatch->isChecked() )
ostream << elB.toDMSString() << space;
else
if(elCheckBatch->isChecked() )
ostream << elB.toDMSString() << space;
sp.setAz(azB);
sp.setAlt(elB);
sp.HorizontalToEquatorial( &LST, &latB );
ostream << sp.ra()->toHMSString() << space << sp.dec()->toDMSString() << endl;
}
}
fOut.close();
}