sgp4/Observer.h

69 lines
1.3 KiB
C
Raw Normal View History

#ifndef OBSERVER_H_
#define OBSERVER_H_
2011-04-23 11:18:51 +00:00
#include "CoordGeodetic.h"
#include "CoordTopographic.h"
#include "Julian.h"
#include "Eci.h"
2011-12-13 22:49:01 +00:00
class Observer
{
public:
2011-12-13 22:49:01 +00:00
Observer(double latitude, double longitude, double altitude)
: geo_(latitude, longitude, altitude),
observers_eci_(Julian(), geo_)
{
}
Observer(const CoordGeodetic &g)
: geo_(g), observers_eci_(Julian(), geo_)
{
}
2011-03-30 15:23:45 +00:00
2011-12-13 22:49:01 +00:00
virtual ~Observer()
{
}
void SetLocation(const CoordGeodetic& g)
{
geo_ = g;
observers_eci_ = Eci(observers_eci_.GetDate(), geo_);
2011-03-30 15:23:45 +00:00
}
2011-12-13 22:49:01 +00:00
CoordGeodetic GetLocation() const
{
2011-03-30 15:23:45 +00:00
return geo_;
}
2011-12-13 22:49:01 +00:00
Eci GetEciPosition(const Julian &date) const
{
return Eci(date, geo_);
}
CoordTopographic GetLookAngle(const Eci &eci);
2011-03-30 15:23:45 +00:00
private:
2011-12-13 22:49:01 +00:00
void UpdateObserversEci(const Julian &date)
{
/*
* if date has changed, update for new date
*/
if (observers_eci_.GetDate() != date)
{
observers_eci_ = Eci(date, geo_);
}
}
2011-03-30 15:23:45 +00:00
/*
* the observers position
*/
CoordGeodetic geo_;
/*
* the observers eci for a particular time
*/
Eci observers_eci_;
};
#endif