Updated Observer
parent
4aab9bf601
commit
6e2de1facd
27
Observer.cpp
27
Observer.cpp
|
@ -2,33 +2,6 @@
|
|||
|
||||
#include "Globals.h"
|
||||
|
||||
/*
|
||||
* in degrees!
|
||||
*/
|
||||
Observer::Observer(const double latitude, const double longitude, const double altitude)
|
||||
: geo_(DegreesToRadians(latitude), DegreesToRadians(longitude), altitude),
|
||||
observers_eci_(Julian(), geo_)
|
||||
{
|
||||
}
|
||||
|
||||
Observer::Observer(const CoordGeodetic &geo)
|
||||
: geo_(geo), observers_eci_(Julian(), geo_)
|
||||
{
|
||||
}
|
||||
|
||||
Observer::~Observer(void) {
|
||||
}
|
||||
|
||||
void Observer::UpdateObserversEci(const Julian &date) {
|
||||
|
||||
/*
|
||||
* if date has changed, update for new date
|
||||
*/
|
||||
if (observers_eci_.GetDate() != date) {
|
||||
observers_eci_ = Eci(date, geo_);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* calculate lookangle between the observer and the passed in Eci object
|
||||
*/
|
||||
|
|
42
Observer.h
42
Observer.h
|
@ -6,29 +6,53 @@
|
|||
#include "Julian.h"
|
||||
#include "Eci.h"
|
||||
|
||||
class Observer {
|
||||
class Observer
|
||||
{
|
||||
public:
|
||||
Observer(const double latitude, const double longitude, const double altitude);
|
||||
Observer(const CoordGeodetic &geo);
|
||||
virtual ~Observer(void);
|
||||
Observer(double latitude, double longitude, double altitude)
|
||||
: geo_(latitude, longitude, altitude),
|
||||
observers_eci_(Julian(), geo_)
|
||||
{
|
||||
}
|
||||
|
||||
void SetLocation(const CoordGeodetic& geo) {
|
||||
geo_ = geo;
|
||||
Observer(const CoordGeodetic &g)
|
||||
: geo_(g), observers_eci_(Julian(), geo_)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Observer()
|
||||
{
|
||||
}
|
||||
|
||||
void SetLocation(const CoordGeodetic& g)
|
||||
{
|
||||
geo_ = g;
|
||||
observers_eci_ = Eci(observers_eci_.GetDate(), geo_);
|
||||
}
|
||||
|
||||
CoordGeodetic GetLocation() const {
|
||||
CoordGeodetic GetLocation() const
|
||||
{
|
||||
return geo_;
|
||||
}
|
||||
|
||||
Eci GetEciPosition(const Julian &date) const {
|
||||
Eci GetEciPosition(const Julian &date) const
|
||||
{
|
||||
return Eci(date, geo_);
|
||||
}
|
||||
|
||||
CoordTopographic GetLookAngle(const Eci &eci);
|
||||
|
||||
private:
|
||||
void UpdateObserversEci(const Julian &date);
|
||||
void UpdateObserversEci(const Julian &date)
|
||||
{
|
||||
/*
|
||||
* if date has changed, update for new date
|
||||
*/
|
||||
if (observers_eci_.GetDate() != date)
|
||||
{
|
||||
observers_eci_ = Eci(date, geo_);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* the observers position
|
||||
|
|
Loading…
Reference in New Issue